Prepare a subflow
Review the process of preparing a subflow for use in a parent workflow, and for preparing the parent workflow to use a subflow.
프로시저
- In the editor, open and check out the workflow that you want to use as a subflow.
-
In the title bar, click the menu icon and select Edit
Inputs.
- In the Workflow Inputs window, click New in the Variables list.
-
Add a new variable depending on the type of values that it is going to
store.
The following example sets up a string value.
- Click Submit.
- Close the Workflows Inputs dialog.
-
Create a Run Script activity on the subflow.
- Set the value from the parameter to a field on the current form. This is
important because the Notification activity can
only pull values from the current variable and not from the newly added
variable. The following example sets the value in the
Description field.
current.description = workflow.inputs.bluesubvariable; - Create a new field on the request form but do not display the field.
This serves as temporary storage.
- Set the value from the parameter to a field on the current form. This is
important because the Notification activity can
only pull values from the current variable and not from the newly added
variable. The following example sets the value in the
Description field.
-
Create a Notification activity on the subflow and use
${description}in the subject to return the value from the field.This is what the subflow would look like:
Prepare a workflow to use a subflow
After you create a subflow, use this procedure to prepare the parent workflow.
프로시저
-
On the parent workflow, create a variable similar to what you did on the
subflow, but name it something different.
In the following example, the variable is named Blue Main Variable.
- Click Submit.
-
Insert a Run Script activity to return the value from a
field to the newly created variable.
In this example, the value of the Short Description field is returned and given to the newly created variable.
workflow.scratchpad.bluemainvariable = current.short_description; - Click Submit.
-
In the subflow activity, set the Blue Sub Variable to
pass the
bluemainvariableto thebluesubvariable.${workflow.scratchpad.bluemainvariable}This is what the main workflow looks like: