|
///////////////////////////////////////////////////////////
// CommunicationValve.cs
// Implementation of the Class CommunicationValve
// Generated by Enterprise Architect
// Created on: 24-Sep-2008 17:06:18
// Original author: JAGG
///////////////////////////////////////////////////////////
using System;
using System.Workflow.Activities;
using jagg.ClassCommunication;
namespace jagg.ClassCommunication
{
public class CommunicationValve : ICommunicationValve
{
#region WF -> Host Communication
public event EventHandler<ExternalValveEventArgs> EventValveStatus;
/// <summary>
/// Used by CallExternalEvent Argument to pass the valve status to Host
/// </summary>
/// <param name="status">Valve status OPEN / CLOSE / EXIT</param>
public void StatusValve(Guid wfGuid, string status)
{
if (EventValveStatus != null)
{
ExternalValveEventArgs e = new ExternalValveEventArgs(wfGuid);
e.Status = status;
EventValveStatus(this, e); //Raise the event
}
}
#endregion
#region Host -> WF
/// <summary>
/// Use to pass the valve operation to workflow
/// </summary>
public event EventHandler<ExternalDataEventArgs> CloseValve;
/// <summary>
/// Use to pass the valve operation to workflow
/// </summary>
public event EventHandler<ExternalDataEventArgs> Exit;
/// <summary>
/// Use to pass the valve operation to workflow
/// </summary>
public event EventHandler<ExternalDataEventArgs> OpenValve;
#endregion
#region Auxiliar procedures
/// <summary>
/// Raise the event Exit
/// </summary>
/// <param name="instanceId">workflow instance</param>
public void RaiseExit(Guid instanceId)
{
if (Exit != null)
{
ExternalDataEventArgs e = new ExternalDataEventArgs(instanceId);
e.WaitForIdle = true;
Exit(null, e);
}
}
/// <summary>
/// Raise the event Open
/// </summary>
/// <param name="instanceId">workflow instance</param>
public void RaiseOpen(Guid instanceId)
{
if (OpenValve != null)
{
ExternalDataEventArgs e = new ExternalDataEventArgs(instanceId);
OpenValve(null, e);
}
}
/// <summary>
/// Raise the event Close
/// </summary>
/// <param name="instanceId">workflow instance</param>
public void RaiseClose(Guid instanceId)
{
if (CloseValve != null)
{
ExternalDataEventArgs e = new ExternalDataEventArgs(instanceId);
CloseValve(null, e);
}
}
#endregion
}//end CommunicationValve
}//end namespace ClassCommunication
|
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.
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 Mexico working for Twenty Century Fox, and Mexico Stock Exchange (BMV). From 2013 to now in USA, Florida, First in FAME Inc. and now as Senior Software Engineer in Spirit Airlines.