Skip to main content

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.

BPL diagram with sequence of steps

Steps to Create a Scenario

Within a BPL business process, use the following procedure to add each scenario to the business process:

  1. Add a <code> element to create the scenario object. Specifically, for this element, specify Code as follows:

     do context.createNewScenario()
    

    For example:

    Code is do context.createNewScenario()

    This step adds a new property to the context object, so that now you can set properties of context.newScenario.

  2. 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:

    set property context.newScenario.optionName equal to Option A

  3. 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:

    code is do context.addScenarioToAnalysis()

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.

See Also

FeedbackOpens in a new tab