Defining sub processes
The Fabasoft Folio Workflow Engine allows you to invoke a sub process from within a process. An activity is used as a container to embed a sub process within a process. The sub process is expanded on demand when the workflow reaches the activity acting as a container for the sub process.
A sub process is defined just like an ordinary process using the process keyword.
Syntax |
activity { subproc = subprocess; } |
The activity keyword is used to embed a sub process within a process, but instead of defining actor and steps for the activity you just need to reference the sub process using the subproc keyword.
Example |
processes APPDUCXSAMPLE@200.200 { import COOSYSTEM@1.1; import COOWF@1.1; // Definition of sub process APPDUCXSAMPLE@200.200:DeptMgrApprovalWF process DeptMgrApprovalWF { activity { actor { pos = DeptSecretary; orgunit = OrderProcessing; } step ApproveOrder required leave { execute = ApproveOrder; } step DenyApproval required leave { execute = DenyOrderApproval; } } } if (object.preapproved) { activity { actor { pos = DeptManager; orgunit = OrderProcessing; } step ApproveOrder required leave { execute = ApproveOrder; } step DenyApproval required leave { execute = DenyOrderApproval; } } } // This process may only be used as a sub process, and may not be // instantiated directly on an object procdefstate = PROCDEF_SUBPROCESS; } process ApproveOrderWF { parallel { activity { actor { pos = Clerk; orgunit = OrderProcessing; } step ApproveOrder required leave { execute = ApproveOrder; } step DenyApproval required leave { execute = DenyOrderApproval; } } // Embedding sub process APPDUCXSAMPLE@200.200:DeptMgrApprovalWF activity { subproc = DeptMgrApprovalWF; } } } } |