1 / 65

Aspose.Workflow Introduction

Aspose.Workflow Introduction. Aspose.Workflow Introduction. Pure .Net components Fully XPDL ( http://www.wfmc.org/standards/XPDL.htm ) supports Implements WFMC ( http://www.wfmc.org ) standards Integrate with Asp.Net, VB.Net, WinForm applications.

alexa
Download Presentation

Aspose.Workflow Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Aspose.Workflow Introduction

  2. Aspose.Workflow Introduction • Pure .Net components • Fully XPDL (http://www.wfmc.org/standards/XPDL.htm) supports • Implements WFMC (http://www.wfmc.org) standards • Integrate with Asp.Net, VB.Net, WinForm applications. • Support .Net Framework 1.1 and above (tested with .Net Framework 2.0beta) • Popular database system support (SQLServer and oracle)

  3. Aspose.Workflow Status • Aspose.Workflow 1.0.5 released. • Aspose.Workflow Designer is in progress, and it will be ready in next major release. • For one month, there will be at least 1 maintain release, at most 2. • HotFix will based on customer request and no time restrictions.

  4. Designer • Aspose.Workflow will provide an pure C# written graphical designer • Currently the Designer is 50% finished, it will coming in the next major release (Aspose.Workflow 1.1.0)

  5. Dock pannels Shape Explores Mini Map Zoom In/Out Designer (Cont.)

  6. Package Explorer Properties Editors Designer (Cont.)

  7. WFMC and XPDL Introduction

  8. XPDL Introduction • WFMC provides an interface for workflow process definition. That interface defines a common meta-model for describing the process definition and XML schema for interchange of process definitions - XPDL (XML Process Definition Language) • The workflow process definition interface defines a common interchange format, which supports the transfer of workflow process definitions between different products.

  9. XPDL Introduction (Cont.) • A workflow process definition, generated by Aspose.Workflow designer or JAWE, is capable of interpretation in different workflow run-time products.

  10. XPDL Introduction (Cont.) • The principles of Process Definition Interchange are based on Meta-Model framework. This meta-data model identifies commonly used entities within a process definition, their relationships and attributes. A variety of attributes describe the characteristics of this limited set of entities.

  11. XPDL Meta Model • Workflow Package • Workflow Process Definition • Workflow Process Activity • Transition Information • Workflow Participant Declaration • Workflow Application Declaration • Workflow Relevant Data • System & Environmental Data • Resource Repository or Organizational Model • Data Types and Expressions

  12. XPDL Package • Workflow Process Definition, • Workflow Participant Specification, • Workflow Application Declaration and • Workflow Relevant Data • External Workflow Package references

  13. XPDL Process • Workflow Activity set • Workflow Activity Definition • Transitions • Workflow Participant Specification, • Workflow Application Declaration and • Workflow Relevant Data • All process will inherit the “Relevant data”, ”Participant”, ”Application” from the parent package.

  14. Contract Workflow Tutorial Design the Contract Workflow Model using Designer

  15. Contract Preparation Process Description • Contract coordinators create new contracts. • Contract reviewers review and either approve or deny contracts. • A consultant will do some consultant work on based on the contracts • When consultant work done, the invoice creator will send out a invoice. • ………

  16. Set the ID to “ContractWorkflow_Tutorial” The Id must be unique inside the whole engine Also give a new name to the package Set the script type to VB Create new Package

  17. New Created Package XPDL <?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://www.wfmc.org/2002/XPDL1.0" xmlns:xpdl="http://www.wfmc.org/2002/XPDL1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Id="ContractWorkflow_Tutorial" Name="ContractWorkflow_Tutorial" xsi:schemaLocation="http://www.wfmc.org/2002/XPDL1.0 http://wfmc.org/standards/docs/TC-1025_schema_10_xpdl.xsd"> <PackageHeader> <XPDLVersion>1.0</XPDLVersion> <Vendor>Aspose.Workflow</Vendor> <Created>2005-09-16 10:31:14</Created> </PackageHeader> <RedefinableHeader PublicationStatus="UNDER_TEST"/> <ConformanceClass GraphConformance="NON_BLOCKED"/> <Script Type="VB"/> <ExtendedAttributes> <ExtendedAttribute Name="MadeBy" Value=“Aspose.Workflow Designer"/> <ExtendedAttribute Name="Version" Value="1.0"/> <ExtendedAttribute Name="Owner" Value="Aspose.Workflow"/> </ExtendedAttributes> </Package>

  18. Add the three participant of the contract preparation process Create Reviewer,consultant,invoiceCreator Set each participant type to Role Add Participants

  19. Participants

  20. Participant XPDL <Participants> <Participant Id="reviewer" Name="reviewer"> <ParticipantType Type="ROLE"/> <Description>This is the Contract reviewer</Description> </Participant> <Participant Id="Consultant" Name="Consultant"> <ParticipantType Type="ROLE"/> <Description>This is the Consultant</Description> </Participant> <Participant Id="InvoiceCreator" Name="InvoiceCreator"> <ParticipantType Type="ROLE"/> <Description>This is the InvoiceCreator</Description> </Participant> </Participants>

  21. Create the new workflow process called “Contract_Preparation” Create the Contract Process

  22. <WorkflowProcesses> <WorkflowProcess AccessLevel="PUBLIC" Id="Contract_Preparation" Name="Contract_Preparation"> <ProcessHeader DurationUnit="D"> <Created>2005-09-16 10:47:15</Created> </ProcessHeader> <RedefinableHeader PublicationStatus="UNDER_TEST"> <Author>Aspose.Workflow</Author> <Version>1.0</Version> </RedefinableHeader> </WorkflowProcess> </WorkflowProcesses> Contract Process (Cont.)

  23. Contract Workflow (Cont.)

  24. Applications is using to interactive with external system. For this tutorial, the applications will operate on the “Contracts” database table. There are four applications currently: ApproveContract UpateContractState ConsultantContract CreateInvoice Create Applications

  25. Set the parameter id Mode In/Out/Inout Set the parameter type Create Application (Cont.)create parameters for application

  26. The application ApproveContract has four parameters ContractId In String Reviewer In String IsRejected In Boolean State Inout String Parameters (Cont.)

  27. <Application Id="ApproveContract"> <FormalParameters> <FormalParameter Id="ContractId" Mode="IN"> <DataType> <BasicType Type="STRING"/> </DataType> </FormalParameter> <FormalParameter Id="Reviewer" Mode="IN"> <DataType> <BasicType Type="STRING"/> </DataType> </FormalParameter> <FormalParameter Id="IsRejected" Mode="IN"> <DataType> <BasicType Type="BOOLEAN"/> </DataType> </FormalParameter> <FormalParameter Id="State" Mode="INOUT"> <DataType> <BasicType Type="STRING"/> </DataType> </FormalParameter> </FormalParameters> </Application> The Applications XPDL(ApproveContract)

  28. The Applications XPDL (Cont.)(UpdateContractState) <Application Id="UpdateContractState"> <FormalParameters> <FormalParameter Id="ContractId" Mode="IN"> <DataType> <BasicType Type="STRING"/> </DataType> </FormalParameter> <FormalParameter Id="State" Mode="IN"> <DataType> <BasicType Type="STRING"/> </DataType> </FormalParameter> </FormalParameters> </Application>

  29. <Application Id="ConsultContract"> <FormalParameters> <FormalParameter Id="ContractId" Mode="IN"> <DataType> <BasicType Type="STRING"/> </DataType> </FormalParameter> <FormalParameter Id="Consultant" Mode="IN"> <DataType> <BasicType Type="STRING"/> </DataType> </FormalParameter> <FormalParameter Id="Advice" Mode="IN"> <DataType> <BasicType Type="STRING"/> </DataType> </FormalParameter> </FormalParameters> </Application> The Applications XPDL (Cont.) (ConsultContract)

  30. <Application Id="CreateInvoice"> <FormalParameters> <FormalParameter Id="ContractId" Mode="IN"> <DataType> <BasicType Type="STRING"/> </DataType> </FormalParameter> <FormalParameter Id="Amount" Mode="IN"> <DataType> <BasicType Type="FLOAT"/> </DataType> </FormalParameter> <FormalParameter Id="InvoiceCreator" Mode="IN"> <DataType> <BasicType Type="STRING"/> </DataType> </FormalParameter> </FormalParameters> </Application> </Applications> The Applications XPDL (Cont.) (CreateInvoice)

  31. Data fields is the process/package local variables to hold process instance related data Data fields can use as the actual parameter for the applications’ formal parameter Create DataFields

  32. Contract Workflow DataFields • ContractId string indicate the id of contract • Reviewer string the reviewer’s name • Creator string the contract creator. • IsRejcted boolean indicate if the contract is rejected • State string indicate current contract state • Consultant string the contract consultant’s name • Advice string the consultant’s advice • Amount string the invoice amount • InvoiceCreator the creator of invoice

  33. <DataFields> <DataField Id="ContractId" IsArray="FALSE"> <DataType> <BasicType Type="STRING"/> </DataType> </DataField> <DataField Id="Reviewer" IsArray="FALSE"> <DataType> <BasicType Type="STRING"/> </DataType> </DataField> <DataField Id="Creator" IsArray="FALSE"> <DataType> <BasicType Type="STRING"/> </DataType> </DataField> <DataField Id="IsRejected" IsArray="FALSE"> <DataType> <BasicType Type="BOOLEAN"/> </DataType> </DataField> Contract Workflow Data Fields XPDL

  34. <DataField Id="State" IsArray="FALSE"> <DataType> <BasicType Type="STRING"/> </DataType> </DataField> <DataField Id="Consultant" IsArray="FALSE"> <DataType> <BasicType Type="STRING"/> </DataType> </DataField> <DataField Id="Amount" IsArray="FALSE"> <DataType> <BasicType Type="STRING"/> </DataType> </DataField> <DataField Id="InvoiceCreator" IsArray="FALSE"> <DataType> <BasicType Type="STRING"/> </DataType> </DataField> </DataFields> Contract Workflow Data Fields XPDL (Cont.)

  35. Contract Workflow Data Fields XPDL (Cont.) <DataField Id="Advice" IsArray="FALSE"> <DataType> <BasicType Type="STRING"/> </DataType> </DataField>

  36. Add Start (Black round shape), End to the graph Each process must at least have one start and one end Create the process

  37. Add the first activity of contract preparation “Approve Contract” The “Approve Contract” performer will be the pre-created participant “Reviewer” When “Approve Contract” is done, it will call two applications: ApproveContract UpdateContractState Be sure to map the data fields to the applications parameters Create Process (cont.)

  38. <Activity Id="ContractModel_Act1" Name="Contract Review"> <Implementation> <Tool Id="ApproveContract" Type="APPLICATION"> <ActualParameters> <ActualParameter>ContractId</ActualParameter> <ActualParameter>Reviewer</ActualParameter> <ActualParameter>IsRejected</ActualParameter> <ActualParameter>State</ActualParameter> </ActualParameters> </Tool> <Tool Id="UpdateContractState" Type="APPLICATION"> <ActualParameters> <ActualParameter>ContractId</ActualParameter> <ActualParameter>State</ActualParameter> </ActualParameters> </Tool> </Implementation> <Performer>Reviewer</Performer> <StartMode> <Manual/> </StartMode> <FinishMode> <Automatic/> </FinishMode> </Activity> Approve Contract XPDL

  39. Based on the review result the continue process will go to different transitions Approved : go to consultant work Rejected : go to contract rejcted The condition test will be store in activities “Transition restriction” Create process (Cont.)

  40. <TransitionRestrictions> <TransitionRestriction> <Split Type="XOR"> <TransitionRefs> <TransitionRef Id="ContractWorkflow_Tra2"/> <TransitionRef Id="ContractWorkflow_Tra3"/> </TransitionRefs> </Split> </TransitionRestriction> </TransitionRestrictions> Split Type = XOR means only one transition can be followed The detailed transition settings is stored in transition definition here only reference them using “TransitionRef” Transition Restriction XPDL

  41. <Transition From=“ApproveContract" Id="ContractWorkflow_Tra2" To=“ContractRejcted"> <Condition Type="CONDITION">IsRejected</Condition> <ExtendedAttributes> <ExtendedAttribute Name="RoutingType" Value="NOROUTING"/> </ExtendedAttributes> </Transition> This transition is the From “ApproveContract” to “ContractRejected” The condition expression “IsRejected” means when the data field “IsRejected” is true, this transition will be followed You can set the condition type to “OTHERWISE”, means follow the transition if all other transition from the same activity whose condition result are false Transition XPDL

  42. The activity follow Contract Rejected will be end The activity follow Consultant work will be Create Invoice Like “Approve Contract”, “Consultant work” will also have two applications need to call when the activity execute ConsultantContract UpdateContractState ConsultantWork’s performer will be “Consultant” “Contract Rejected” is a special activity, it will execute automatically by the Workflow engine system. Set the performer type to “SYSTEM” Set the Start Mode to “AUTOMATIC” Continue…

  43. Create Invoice will call application CreateInvoice UpdateContractState “Send Invoice” is same as “Contract Rejected”, it is an automatically state Performer type is SYSTEM Start Mode is “AUTOMATIC” Continue….

  44. Modeling End • Save the model into file • A full version of the XPDL can be found at http://www.aspose.com/Products/Aspose.Workflow/LiveDemo/ContractModel.xpdl

  45. Contract Workflow Tutorial Run the Contract Workflow Model using Aspose.Workflow engine

  46. Aspose.Workfow Engine Runtime Overview • Aspose.Workflow engine runtime include below steps: • Configuration the Aspose.Workflow Engine • Upload the XPDL model file to the engine • Map the applications defined in the XPDL file to real tool agent implementation classes • Map the participant defined in XPDL file to real username • Start Process instance • Using worklist to accept/complete tasks. • Monitoring the engine using Monitor Service

  47. ContractWorkflow Asp.Net implementation • All source can be found in the installer package • Find the online version on http://www.aspose.com/Products/Aspose.Workflow/Demos/ContractWorkflow/

  48. Aspose.Workflow configuration <appSettings> <add key="RootDirectoryPath" value="D:\stone\work\dotnet\Workflow\src\Demos\ContractWorkflow"/> <add key="engine.name" value="Aspose.Workflow.Demos.ContractWorkflow" /> <add key="ConnectionString" value="Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=${RootDirectoryPath}\storage\repository\Aspose.Workflow.mdb" /> <add key="LogFilePath" value="${RootDirectoryPath}\storage\log\Aspose.Workflow.log" /> <add key="LogLevel" value="INFO" /> <add key="package.repository.path" value="${RootDirectoryPath}\storage\repository\external" /> </appSettings>

  49. Initialization of ContractWorkflow • Please refer to the Initialize.aspx.cs in the demos source code • Get the Aspose.Workflow engine Instance IEngine engine = EngineManager.Instance.Engine; engine.Login("aspose","aspose"); • Upload package IPackage package = engine.PackageAdmin.UploadPackage( engine.Properties["RootDirectoryPath"] + @"\ContractPackage.xpdl");

  50. Map the Participant to User IParticipant[] participants = package.GetAllProcesses()[0].Participants; foreach(IParticipant part in participants) { if (part.Id.Equals("Reviewer")) { part.MapUser("reviewer1"); } else if (part.Id.Equals("Consultant")) { part.MapUser("consultant1"); } else if (part.Id.Equals("InvoiceCreator")) { part.MapUser("invoiceCreator1"); } }

More Related