Adding Workflow Scenarios
Within a BPL business process that examines a supply chain issue, you can include workflow, and you may need to present different scenarios to present to the users. In InterSystems Supply Chain Orchestrator™, this is easy to do.
This page describes how to create and populate a scenario object within a workflow.
Each scenario has a name, a description, and various properties such as the time and cost impact. Rather than having to define custom properties within the BPL, you can use the data object SC.Core.Data.Internal.ActionScenario, which already has the necessary properties.
Overview
As an overview, here is a screenshot of the relevant part of an example BPL diagram.
Steps to Create a Scenario
Within a BPL business process, use the following procedure to add each scenario to the business process:
-
Add a <code> element to create the scenario object. Specifically, for this element, specify Code as follows:
do context.createNewScenario()
For example:
This step adds a new property to the context object, so that now you can set properties of context.newScenario.
-
Include a set of <assign> elements, each of which specifies the value of a scenario property. For example, you might assign the optionName property like this:
-
Once you have specified all the properties, add a <code> element to create the scenario object. Specifically, for this element, specify Code as follows:
do context.addScenarioToAnalysis()
For example:
After the above steps are completed, the same set of steps can be repeated for another scenario.
Please keep in mind that these steps supplement the usual InterSystems IRIS® guidelines to implement the rest of the workflow.
Scenario Properties
The scenario object is defined by the class SC.Core.Data.Internal.ActionScenario, which has the following properties for you to set as described here:
-
optionNumber — A very short identifier for the option such as a single letter or a single number, for use in presentation to the users. For an example, see Example Issue Analysis.
-
optionName — A user-friendly short name of the option.
-
description — A user-friendly description of the option.
-
supportingData — Supporting data used in the analysis, such as inventory position, labor availability, etc.
-
feasibility — Describes how feasible the scenario is, on a numeric scale.
-
recommended — Indicates if this is the recommended scenario.
-
costImpact — The financial impact of the option/scenario (numeric).
-
timeImpact — Time impact of the scenario.
For data types and length limits, view SC.Core.Data.Internal.ActionScenario in the local class reference or in your choice of IDE.