Click here to Skip to main content
13,299,727 members (67,225 online)
Click here to Skip to main content


23 bookmarked
Posted 4 Oct 2008

Host and Workflow: Two Worlds to Communicate. Part V

, 4 Oct 2008
Part V: Intercommunications with a Workflow instance using Correlation parameter
using System;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Drawing;
using System.Linq;
using System.Workflow.ComponentModel.Compiler;
using System.Workflow.ComponentModel.Serialization;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.Workflow.Runtime;
using System.Workflow.Activities;
using System.Workflow.Activities.Rules;

namespace CorrelationDemo
	public sealed partial class MailFactory: SequentialWorkflowActivity
        //use to hold the input parameter
        private string customer = string.Empty;
        public string orderNumber = string.Empty;

        public string Customer
            get { return customer; }
            set { customer = value; }

        public MailFactory()

        private void InitWorkflow(object sender, EventArgs e)
            //Simula a analisys of the customer to get the order nummer
            //now is hard-wired to one order
            orderNumber = "B1234567";
            idInstance = this.WorkflowInstanceId;

        public static DependencyProperty idInstanceProperty = DependencyProperty.Register("idInstance", typeof(System.Guid), typeof(CorrelationDemo.MailFactory));

        public Guid idInstance
                return ((System.Guid)(base.GetValue(CorrelationDemo.MailFactory.idInstanceProperty)));
                base.SetValue(CorrelationDemo.MailFactory.idInstanceProperty, value);

        public String EmailAddressProvider = default(System.String);
        public String EmailAddressCustomer = default(System.String);
        public String NotificationMessageProvider = default(System.String);
        public String NotificationMessageCustomer = default(System.String);

        private void FillProviderNotification(object sender, EventArgs e)
            NotificationMessageProvider = string.Format("The Provider Address is {0}", EmailAddressProvider);


        private void FillCustomerNotification(object sender, EventArgs e)
            NotificationMessageCustomer = string.Format("The Customer Address is {0}", EmailAddressCustomer);



By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior) Avalon Development
United States United States
Jose A. Garcia Guirado, Electronic Engineer, graduated in Havana/Cuba 1982, MCTS, MCSD.NET, MCAD.NET, MCSE. Worked in the Institute for Cybernetics and Mathematics of Academy of Science of Cuba for 8 years; since 1995 working as free software architect, developer and adviser, first in Argentina and from 2003 to 2010, in Germany as External consultant in DWS Luxembourg, AIXTRON AG and Shell Deutschland GmbH and from 2010 to 2012 in in Mexico in Twenty Century Fox, and Mexico Stock Exchange (BMV). Actually as freelancer in Florida, USA.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.171207.1 | Last Updated 4 Oct 2008
Article Copyright 2008 by freedeveloper
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid