- aal-4_src.zip
- csaal
- bin
- Debug
- Release
- bootstrapLoader
- componentManager
- dataHub
- docs
- AAL-1
- CVS
- AAL-2
- AAL-2
- AAL-3
- AAL-4
- aspect oriented programming
- AOP
- CPstyles
- CVS
- notes
- CVS
- Base
- ProxyDelegate
- CVS
- downloads
- MDISample
- MenuImage
- bin
- Debug
- Release
- obj
- Debug
- temp
- TempPE
- Release
- temp
- TempPE
- MenuImageLib
- bin
- Debug
- Release
- obj
- Debug
- temp
- TempPE
- Release
- temp
- TempPE
- Ethernet
- lib
- MenuManager
- testComponent
- webpages
- DataHub
- images
- The Code Project - The Application Automation Layer - The Data Hub Implementation - C# Programming_files
- WindowFormManager
- worflowManagerManagedThreadPool.cs
- workflowManager
|
using System;
using System.Collections;
/*
Manages the execution of workflow processes. A workflow:
1. consists of a sequence of one or more actions;
2. may include conditionals to control which actions are performed;
3. may include iteration to repeat a series of actions;
4. may invoke sub-processes.
Additionally:
1. Workflows are initiated via events and/or direct calls;
2. Workflows are script based
a. Simple <component>.<function> implementation
b. Parameters are defined in a parameter definition section
c. Parameters are packaged based on parameter sequence and the parameter definition section
d. Iteration and conditionals are supported through the workflow component (2a)
3. Workflows can be graphically represented in Visio
a. Each component provides:
1) a component level icon (as a stencil reference)
2) an optional icon for each function (as a stencil reference)
3) icons are stored in Visio stencils
4. Individual actions can be executed directly or initiated in a separate thread
a. Execution continues when started as a separate thread
Do we need a tool to build scripts visually/graphically?
*/
namespace AAL
{
public sealed class WorkflowManager
{
private static WorkflowManager workflowManager;
private static ICore.IComponentManager icm;
private IWM iwm;
private ICore.IDataHub idh;
/// <summary>
/// Phase 1 initialization.
/// </summary>
/// <param name="icm">The Component Manager interface.</param>
/// <returns></returns>
public static ICore.IWorkflowManager Init1(ICore.IComponentManager icm)
{
WorkflowManager.icm=icm;
workflowManager=new WorkflowManager();
return workflowManager.iwm;
}
/// <summary>
/// Phase 2 initialization.
/// </summary>
public static void Init2()
{
workflowManager.idh=icm.GetInterface("DataHub") as ICore.IDataHub;
}
/// <summary>
/// Constructor.
/// </summary>
public WorkflowManager()
{
iwm=new IWM(this); // instantiate interface
icm.RegisterInterfacePoint("WorkflowManager", "Run", new InterfacePoint(Run));
}
/// <summary>
/// The Workflow Manager is responsible for interfacing with the Data Hub to
/// create a workflow. A workflow combines both data and task information. By
/// using the Workflow Manager, it can pass on the workflow data initialization to
/// the Data Hub while performing necessary workflow task initialization here.
/// This is currently a stub function.
/// </summary>
/// <param name="name">The workflow domain name.</param>
public void CreateWorkflowDomain(string name)
{
idh.CreateWorkflowDomain(name);
}
/// <summary>
/// The Workflow Manager is responsible for interfacing with the Component Manager
/// to invoke component service. This gives the Workflow Manager the opportunity
/// to create invoke a service as a separate thread, measure performance, etc.
/// This is currently a stub function.
/// </summary>
/// <param name="eventName">The event name.</param>
/// <param name="eventData">The associated event data.</param>
public void FireEvent(string eventName, EventData eventData)
{
Dbg.WriteLine("Event: "+eventName);
icm.Invoke(eventName, eventData);
}
/// <summary>
/// Begin a workflow process, as defined by a script.
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
private object Run(EventData eventData)
{
string fnc;
eventData.UnMarshal("Function", out fnc);
if (fnc != "")
{
icm.Invoke(fnc, eventData);
}
return null;
}
}
}
|
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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here