Copyright © Cloud Software Group, Inc. All rights reserved.
Copyright © Cloud Software Group, Inc. All rights reserved.


Chapter 5 Calling a Dynamic Number of Sub-Procedures : Defining a Dynamic Call to Multiple Sub-Procedures

Defining a Dynamic Call to Multiple Sub-Procedures
To add a dynamic call to multiple sub-procedures:
1.
The Select Sub-Procedure Parameter Template To Use dialog is displayed.
2.
The Dynamic Sub-Procedure Call Definition dialog is displayed.
3.
In the Call Reference Name field, enter a name for the dynamic sub-procedure call.
4.
In the Call Reference Description, enter a description for the call.
5.
From the Sub-Procedure Name Array drop-down list, select the array field that will be used to determine the sub-procedure names to call. These will be defined at run-time when the case is run because the array field will contain dynamic data. One sub-case for each element in the array will be started.
6.
(Optional) From the Start Step Array drop-down list, select the array field that determines which step each sub-procedure will start at.
The default start step for all the sub-procedures called is the first step in the procedure.
7.
Click the Ignore case suspend check box if you want the step to be processed as normal while a case is suspended by an SPO or SAL application.
If Ignore case suspend is not checked (the default option), the step is not processed while the case is suspended.
8.
(Optional) Select the Don’t delete outstanding cases on withdraw option. If this option is selected, and the deadline on an outstanding step expires:
9.
(Optional) Click the Error Handling tab to define the error handling conditions that are applied if there are problems with the dynamic sub-procedure call. See Troubleshooting Dynamic Sub-Procedure Calls for more information.
10.
(Optional) Click Deadlines to set a deadline on this step. See “Defining a Deadline” in TIBCO iProcess Modeler Basic Design.
11.
12.
Click OK to save your settings. To edit your dynamic sub-procedure call settings at any time - see Editing a Dynamic Sub-Procedure Call Step.
If the sub-procedure array field is not selected, the step will be marked as incomplete and so the main procedure will also have a status of incomplete.
Defining Input and Output Mappings Using a Sub-Procedure Parameter Template
This section describes how to define the input and output mappings for a dynamic sub-procedure call. The parameter template defines the parameters that can be used for mapping.
See:
Defining a Sub-Procedure Parameter Template for more information about creating a parameter template.
Defining Input Parameter Mappings for information about defining the input mappings for the sub-procedure
Defining Output Parameter Mappings for information about defining the output mappings for the sub-procedure.
Defining Input Parameter Mappings
After defining the dynamic sub-procedure call details (see Defining a Dynamic Call to Multiple Sub-Procedures), you need to define how the sub-procedure input parameters will be mapped to the main procedure.
To map sub-procedure input parameters to the main procedure:
1.
On the Dynamic Sub-Procedure Call Definition dialog, click Input.
The Input tab is displayed.The list of sub-procedure input parameters defined in the parameter template is displayed. You can map these to appropriate main procedure fields or define an expression or script to map the parameter to.
Parameter to Field Mapping:
To perform a simple parameter to field mapping, do the following:
1.
2.
Mapping Complete Arrays Into Sub-procedures:
To pass complete arrays into sub-procedures, do the following:
1.
2.
To pass complete arrays into and out of sub-procedures, see Example of Passing Complete Arrays into and out of Sub-procedures for more information.
Mapping a Parameter to an Expression:
To map a sub-procedure parameter to an expression, do the following:
1.
2.
Mapping a Parameter With Pre-Defined Values:
If a parameter has had values previously defined for it, the following procedure applies:
1.
Select the sub-procedure parameter. Click in the Mapping Type column and the Preset Values string are inserted if there are pre-defined values.
2.
3.
Click the OK button to exit the Sub-Procedure Call Definition dialog.
Mapping a Parameter to a Script:
To perform extra manipulation of the contents of a parameter, you can map a parameter so that its content is calculated as a result of running the script.
To perform a parameter to script mapping, do the following:
1.
2.
In the Mapped To column select a public script if any have been created or choose <private script> to create a script private to this sub-procedure mapping. You can then click Edit Mapping Script to open the Script Editor and define your script. See Creating a Private Script for more information about creating and using private scripts.
3.
If you want to edit a script, select the parameter containing the script and click Edit Mapping Script. The Script Editor is displayed and you can modify the script.
Defining Output Parameter Mappings
After defining the dynamic sub-procedure call details (in Defining a Dynamic Call to Multiple Sub-Procedures), you need to define what output parameters will be mapped to the main procedure.
Sub-procedure output parameters can be mapped to fields in the main procedure and you can also run a private script after the data mappings have been processed to perform further manipulation of the output values.
To map sub-procedure output parameters to the main procedure:
1.
The Output tab is displayed.A list of the sub-procedure output parameters that have been pre-defined in the sub-procedure parameter template is displayed. You need to map these to the appropriate fields in the main procedure.
Parameter to Field Mapping:
To perform a simple field to field mapping, do the following:
1.
2.
Mapping Complete Arrays out of Sub-procedures:
To pass complete arrays out of sub-procedures, do the following:
1.
2.
To pass complete arrays into and out of sub-procedures, see Example of Passing Complete Arrays into and out of Sub-procedures for more information.
Running an Output Mapping Script
To provide extra manipulation of output values, you have the option to execute a private script on completion of the output mappings. The script can see the sub-procedure output values using keywords with the format $OPn or $OPTn where:
n is a positive integer that is automatically assigned by iProcess to each output parameter.
T denotes that the parameter has been inherited from a template.
The script can also see, and assign values to, the main procedure fields. The following is an example of using a script to manipulate the output values and assign them to fields in the main procedure:
    IF ($OPT1= “add”) THEN
    SPVAL:=$OPT2+$OPT3
    ELSE IF ($OPT1=“subtract”) THEN
    SPVAL:=$OPT2-$OPT3
    ELSE IF ($OPT1=“multiply”) THEN
    SPVAL:=$OPT2 * $OPT3
    ELSE IF ($OPT1= “divide”) THEN
    SPVAL:=$OPT2 / $OPT3
    ENDIF
    FULLNAME:=SCRIPT (“BLDNAME”, 2, $OPT11, $OPT6, $OPT7)
Therefore, if the sub-procedure field associated with $OPT1 has a value of “subtract”, then the SPVAL output parameter will have a value of $OPT2-$OPT3.

Copyright © Cloud Software Group, Inc. All rights reserved.
Copyright © Cloud Software Group, Inc. All rights reserved.