Designer 10.7 | webMethods BPM Process Development Help | Process Engine Processing | Call Activity Concepts | Handling SubprocessModel Documents with Dynamically Invoked Processes
 
Handling SubprocessModel Documents with Dynamically Invoked Processes
This document type is described in pub.prt.CallActivityModel. When invoking a process with dynamic process behavior, it is possible to populate the pub.prt.SubprocessModel document list to invoke two or more callable or referenced processes. For example, when the same dynamically invoked process is called twice, the parent process continues after the first child finishes and does not wait for results from the second child process.
Multiple entries in the pub.prt.SubprocessModel list with the same SubprocessModelId are supported. The return document list contains all entries from executed models where the WaitForSubprocess parameter is set to true. The order of the documents in the return document list is the same as the order in the pub.prt.SubprocessModel input list. For example:
*ModelA returns Doc1
*ModelB returns Doc1
    SubprocessModels[0]
        WaitForSubprocess - true
        SubprocessModelId - ModelA
        ReturnDocuments - Doc1
        SubprocessInstances[0] - *
            +Inputs[0]
                #Type - ModelATrigger
                #Document - ModelATriggerDoc1
        SubprocessInstances[1] - *
            +Inputs[0]
                #Type - ModelATrigger
                #Document - ModelATriggerDoc2
 
    SubprocessModels[1]
        WaitForSubprocess - true
        SubprocessModelId - ModelB
        ReturnDocuments - Doc1
        SubprocessInstances[0] - *
            +Inputs[0]
                #Type - ModelBTrigger
                #Document - ModelBTriggerDoc1
There are two instances of ModelA and one instance of ModelB invoked by the input structure above. The return document list will contain a list of Doc1 documents in the same order as shown above. Each input instance is marked with a number of asterisks that match the output document:
Doc1[0] * Doc1[1] ** Doc1[2] ***
Note that multiple entries in the pub.prt.SubprocessModel list with the same SubprocessModelId value and different WaitForSubprocess settings can make it difficult to locate the return documents. pub.prt.SubprocessModel entries that have the WaitForSubprocess parameter set to false will not have return documents in the list. For example:
*ModelA returns Doc1
    SubprocessModels[0]
        WaitForSubprocess - false
        SubprocessModelId - ModelA
            ReturnDocuments - Doc 1
        SubprocessInstances[0] - *
            +Inputs[0]
                #Type - ModelATrigger
                #Document - ModelATriggerDoc1
 
    SubprocessModels[1]
        Wait For Subprocess - true
        Subprocess ModelId - ModelA
        ReturnDocuments - Doc1
        SubprocessInstances[0] - *
            +Inputs[0]
                #Type - ModelATrigger
                #Document - ModelATriggerDoc2
        SubprocessInstances[1] - *
            +Inputs[0]
                #Type - ModelATrigger
                #Document - ModelATriggerDoc3
There is one instance of ModelA in the first pub.prt.SubprocessModel and two instances of ModelA in the second pub.prt.SubprocessModel invoked by the input structure above. The return document list will contain a list of Doc1 documents in the same order as shown above. Each input instance is marked with a number of asterisks that match the output document:
Doc1[0] ** Doc1[1] ***
The SubprocessInstance with a single asterisk (*) has the WaitForSubprocess parameter set to false, so it is not included in the return document list.
Related Topics