Business Actions and Business Conditions can use any of the following workflow binds.
|
Bind Name |
Description |
|---|---|
|
Current Transition |
Bind available to track properties of a transition currently being performed in a STEP workflow. This allows JavaScript business rules access to information about the event that started the transition and to the message entered as part of submitting the event. The bind is only available from JavaScript-based business conditions and actions executed from within the workflow. That is, actions executed ‘On Entry,’ ‘On Transition,’ or ‘On Exit’ and conditions on transitions. It is not available from workflow start conditions, actions executed when deadlines are reached or conditions on conditionally mandatory attributes. Below is an example of a simple JavaScript action that stores the submit message in a workflow variable. Setup includes the following prerequisites:
var workflowInstance = node.getWorkflowInstance(workflow); var msg = currentTransition.getMessage(); if (!msg) msg = '[none]'; workflowInstance.setSimpleVariable('lastMessage',msg);
Here is an example of a JavaScript condition that checks for presence of message when a specific event is submitted. Setup includes the following prerequisites:
if (currentTransition.getEvent() && 'submit' == currentTransition.getEvent().getID() && !currentTransition.getMessage()){return new messageRequired(); } else {return true; } getEvent() will return the event (object) used to trigger the current transition; should be null if there is no event; getMessage() will return the submit message as a string or null if no message has been supplied. |
|
Current Workflow |
Bind available for conditions evaluated and actions executed from a workflow, giving access to the current workflow. In this example, Current Object is bound to 'currentObject' and Current Workflow is bound to 'currentWorkflow'. The code stores the assignee for the 'Enrich' task in a variable. Notice that this code will only work if the JavaScript is executed from within the workflow and current object is in the 'Enrich' state. var assignee = currentObject.getTaskByID(currentWorkflow.getID(),"Enrich").getAssignee(); |
|
Workflow Parameters |
Bind that allows parameters to be passed to a workflow when it is started. Typically used for Flatplanner / page planner workflows started from the Flatplanner component. |
|
Workflow State |
Bind allows access to Workflow State information from a Smartsheet. |
For an additional bind that is used on a transition in a workflow, see e-Signature in the Business Rules documentation here. This bind forces users to re-authenticate prior to taking action in a workflow in Web UI, and ensures the security of the data being committed.
2017, Stibo Systems