Click here to Skip to main content
12,500,761 members (73,760 online)
Click here to Skip to main content

Stats

22.7K views
360 downloads
23 bookmarked
Posted

Host and Workflow: Two Worlds to Communicate. Part V

, 4 Oct 2008 CPOL
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()
		{
			InitializeComponent();
		}

        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));

        [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
        [BrowsableAttribute(true)]
        [CategoryAttribute("Misc")]
        public Guid idInstance
        {
            get
            {
                return ((System.Guid)(base.GetValue(CorrelationDemo.MailFactory.idInstanceProperty)));
            }
            set
            {
                base.SetValue(CorrelationDemo.MailFactory.idInstanceProperty, value);
            }
        }

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

        public String NotificationMessageCustomer = default(System.String);
        public String NotificationMessageProvider = 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.

License

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

Share

About the Author

freedeveloper
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...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160919.1 | Last Updated 4 Oct 2008
Article Copyright 2008 by freedeveloper
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid