Better flow control in Workflow Design

A Condition transition is used part of decision making process for the purpose of routing in a workflow process.

What we have below is a typical "Yes/No", "Approve/Reject" routing by using the following expression.
status == "Approved"
whereby "status" is a declared Workflow Variable. If the "status" variable contains the exact string of "Approved", then the Workflow would then flows to "Send Approved Proposal".


Expressing more with the expression


In the "expression" field of the transition element found in your workflow process design, one can  actually put in Javascript coding into it.
As long as at the end of it, one of the statement would return a true/false value.

 Example:
var myRegExp = /dog/;
var myText = " My dog smells worse than your dog";
myRegExp.test(myText)
would return a true.
var myRegExp = /dogie/;
var myText = " My dog smells worse than your dog";
myRegExp.test(myText)
would return a false.

And in this workflow design below, we are looking for the string of "Approved" in the variable "status"
/Approved/.test(status)
 
The strings below would result in a true flag being returned.
  • 1-Approved
  • 2-Approved
  • Approved-all
as it matches "Approved" in any part of the string.

Comments

Post a Comment

Popular Posts

Robotic Process Automation and Low-Code: A Quick Introduction, with a Practical Tutorial on Integrating UiPath with Joget

Introducing Joget DX, the Next Generation Open Source Digital Transformation Platform

Kubernetes: What the Hype is All About, and a Practical Tutorial on Deploying Joget for Low-Code Application Development

Blockchain Made Simple: No-Code Apps with Hyperledger Fabric and Joget

Progressive Web Apps: Apple App Store, Google Play Store, It Was Nice Knowing You