Workflow Assets
This section presents workflow assets, including methods, properties, and events.
To learn about creating and building workflows, see Workflows
A rich set of assets is automatically created for each workflow, including methods, properties, and events. Properties and events are also created for each step and decision in the workflow. They are displayed under the workflow in the Assets Panel.
Many of the examples provided below refer to the project LoanProcessing.
This project is used by a finance company to process loan applications.
The project includes two workflows:
LoanApplication
This is the main workflow in the project and manages the process from start to finish:
Step |
Description |
---|---|
Capture Application Details | Shows a callout to capture the applicant's information from the agent. |
Request Loan Decision | Starts another workflow, LoanDecider, that takes the information provided in the previous step, analyzes it, and returns a Yes or No answer. |
(Transition) | The transition to the next step is conditioned to wait for the workflow LoanDecider to end. |
Is Loan Approved |
Decides which step to process next depending on the result received from the workflow LoanDecider . |
Show Approval Message | Displays a callout to inform the agent that the application was approved. |
Show Rejection Message | Displays a callout to inform the agent that the application was rejected. |
LoanDecider
This workflow analyzes the data received from the workflow LoanApplication and then outputs a Yes or No result.
The result is set to Yes if: (Applicant's Cash Assets - Application Debts) > (Requested Loan Amount). Otherwise, the result is set to No.
Step |
Description |
---|---|
Calculate Current Balance | Calculates the applicant's current balance: the difference between the applicant's cash assets and current debt. |
Decide | Sets the workflow's result to Yes or No, depending on whether the applicant's current balance is larger or smaller than the loan requested. |
Workflow Methods
Returns the result of a workflow.
Parameters
Parameter |
Input Type |
Description |
---|---|---|
(None) |
The response is not received immediately after starting the workflow. You must force your workflow to wait for the second workflow to end before attempting to receive its response.
Returns
As per the Return Type set in the workflow's settings.
Example
In the example below, the response received from the workflow LoanDecider is assigned to the variable LoanDecision.
The connector to the step Receive Response is conditioned to wait for the workflow LoanDecider to end.
Sets the result of a workflow. This method can only be used in its own workflow.
Parameters
Parameter Type |
---|
As per the Return Type set in the workflow's settings. |
Returns
(None)
Example
This example first sets the result of the workflow LoadDecider to No. If the IF condition is met, the value of the result is changed to Yes.
Note that the Start method is asynchronous. For example, a workflow Workflow-3 includes a step that starts Workflow-1 and Workflow-2 as below:
When this step is run:
-
Both Workflow-1 and Workflow-2 will start running immediately and they will run in parallel.
-
Workflow-3 will continue running, running in parallel with Workflow-1 and Workflow-2.
Parameters
Parameter Type |
---|
As per the Input Parameters set in the workflow's settings. |
Returns
(None)
Example
In this example, three input parameters were defined for the LoanDecider workflow:
The value of all three parameters are set when that workflow is started:
Workflow Properties
Represents the timeout period set for a workflow.
A workflow's Timeout event is triggered if the workflow runs for longer than the timeout interval. If the timeout interval is set to zero, the Timeout event will never be triggered.
The workflow is not stopped automatically after a timeout, and the workflow's Ended event is not triggered by a timeout.
A workflow's Timeout Interval is set in the workflow's Settings window.
To set a workflow's Timeout Interval:
-
Open the workflow.
-
Click Settings in the top-right corner of the canvas.
-
Under Options > Timeout event trigger period, enter the number of seconds after which the workflow will be considered to have timed out.
-
Click Save.
Parameters
Type |
Read |
Write |
---|---|---|
Date Time |
Yes | No |
Example
The timeout interval for Workflow B is set to 7 seconds.
When the Project is run, the workflow's Timeout Period property is immediately set to 7.
You can create an event handler to specify actions to perform when the Timeout event is triggered. In the example below, when the Timeout event is triggered, a workflow called Handle Timeout is started.
If a workflow is invoked by another workflow, the invoked workflow's Timeout event can be used as a condition on a transition in the invoking workflow to direct that workflow to a step that reacts to the invoked workflow's timeout.
In the example below, Workflow A invokes Workflow B in the step Invoke Workflow B. Both transitions exiting that step are conditional:
-
The top transition is activated if Workflow B ends normally, in other words, when its Ended event is triggered.
-
The lower transition is activated if Workflow B times out, in other words, when its Timeout event is triggered.
Specifies the reason why the workflow was terminated to display in the Automation Portal.
Type |
Read |
Write |
---|---|---|
Text |
Yes | Yes |
Example
For an example application, see here.
Indicates whether a business exception was registered while executing the workflow or not for indication in the Automation Portal. Set to False if a business exception was registered. The Automation Portal assumes that no business exception was registered unless the value is set to False.
Type |
Read |
Write |
---|---|---|
Boolean |
Yes | Yes |
Example
For an example application, see here.
Specifies the business reason for workflow termination to display in the Automation Portal. The parameter Business Execution OK must be set to False before the value of this parameter is set.
Type |
Read |
Write |
---|---|---|
Text |
Yes | Yes |
Example
For an example application, see here.
Workflow Events
Triggered when the workflow ends.
If the workflow times out, the workflow's Timeout event is triggered immediately. The Ended event is not triggered by a timeout. If the workflow ends after timing out, the Ended event will be triggered.
Example
In this example, the step Request Loan Decision starts the workflow LoanDecider. The transition to the next step, Receive Response, is conditioned to wait until the LoanDecider workflow ends.
Triggered if the workflow runs for longer than the period specified by workflow's timeout interval.
For more information and examples, see Timeout Interval.