Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Host and Workflow: Two Worlds to Communicate. Part V

, 4 Oct 2008
Part V: Intercommunications with a Workflow instance using Correlation parameter
host_wf_comm_P5_1.zip
P5ExampleWithoutCorrelation
CommunicationManager
bin
Properties
CorrelationDemo
bin
CorrelationDemoWF.csproj.user
Properties
Settings.settings
P5ExampleWithoutCorrelation.suo
SendAllEmail
bin
Properties
Settings.settings
host_wf_comm_P5_2.zip
P5ExampleWithCorrelation
CommunicationManager
bin
Properties
CorrelationDemo
bin
CorrelationDemoWF.csproj.user
Properties
Settings.settings
P5ExampleWithCorrelation.suo
SendAllEmail
bin
Properties
Settings.settings
using System;
using System.Collections.Generic;
using System.Text;
using System.Workflow.Activities;

namespace CommunicationManager
{
    /// <summary>
    /// Event argument to send the email address to workflow
    /// </summary>
    [Serializable]
    public class MailEventArgs : ExternalDataEventArgs
    {
        string _typo = string.Empty;
        //string _orderNumber = string.Empty;
        string _email = string.Empty;


        public MailEventArgs(Guid instanceId, string typo, string email)
            : base(instanceId)
        {
            _typo = typo;
            _email = email;
        }

        public string Typo
        {
            get { return _typo; }
            set { _typo = value; }
        }

        //public string OrderNumber
        //{
        //    get { return _orderNumber; }
        //    set { _orderNumber = value; }
        //}
        public string Email
        {
            get { return _email; }
            set { _email = value; }
        }

        
    }

    /// <summary>
    /// Event argument to send the email address to workflow
    /// </summary>
    [Serializable]
    public class RequestMailEventArgs : ExternalDataEventArgs
    {
        string _typo = string.Empty;
        string _orderNumber = string.Empty;



        public RequestMailEventArgs(Guid instanceId, string typo, string orderNumber)
            : base(instanceId)
        {
            _typo = typo;
            _orderNumber = orderNumber;
        }

        public string Typo
        {
            get { return _typo; }
            set { _typo = value; }
        }

        public string OrderNumber
        {
            get { return _orderNumber; }
            set { _orderNumber = value; }
        }
        //public string Email
        //{
        //    get { return _email; }
        //    set { _email = value; }
        //}


    }

    /// <summary>
    /// Event arguments to notificate the email sendung
    /// </summary>
    [Serializable]
    public class NotificationEventArgs : ExternalDataEventArgs
    {
        string _notification = string.Empty;
        //string _typo = string.Empty;
 
        public NotificationEventArgs(Guid instanceId, string Notification)
            : base(instanceId)
        {
            _notification = Notification;
        //    _typo = typo;
       }

        //public string Typo
        //{
        //    get { return _typo; }
        //    set { _typo = value; }
        //}

        public string Notification
        {
            get { return _notification; }
            set { _notification = value; }
        }
    }
    
    [ExternalDataExchange]
    public interface IMailCommunication
    {
        #region Workflow To Host
        /// <summary>
        /// Get the email address based on the typo information.
        /// </summary>
        /// <param name="typo">PROVIDER CUSTOMER</param>
        /// <param name="name">Name of the </param>
        void GetEmailAddress(Guid wfId, string typo, string orderNumber);
        /// <summary>
        /// Notify Host that a email was send
        /// </summary>
        /// <param name="wfId"></param>
        /// <param name="Notification"></param>
        void SendEmailNotification(Guid wfId, string Notification);
        
      
        #endregion

        #region Host To Workflow
        /// <summary>
        /// Send the email to workflow
        /// </summary>
        event EventHandler<MailEventArgs> SendEmailToWorkflow;
 
        #endregion

    }
}

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) G-SoftSolutions
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 advisor, first in Argentina and from 2003 to 2010, in Germany as External consultant in DWS Luxemburg, 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 freelance in Florida, USA.
Follow on   Google+

| Advertise | Privacy | Mobile
Web01 | 2.8.140827.1 | Last Updated 4 Oct 2008
Article Copyright 2008 by freedeveloper
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid