A secondary Business Process can be used inside another, initial Business Process. When doing this, pay careful attention to the Pass and Fail columns to make sure the Business Process will act how you need it to.
For example, suppose you want to use a single processing Business Process to sort data (using the ContainsString task) and send it to different Business Processes based on the ContainsString criteria. You could set up a Business Process like this:
Label | Task | Pass | Fail |
---|---|---|---|
read | com.company.example.ra.Read | next | end |
string | ContainsString | processA | processB |
processA | com.company.example.A.bp.Bps | end | end |
processB | com.company.example.B.bp.Bps | end | end |
In this example, the Business Process will:
- Attempt to read the data from a file. If it fails, it will end the process in error. If it passes, it will move to the next task, in which it will...
- See if a specific field contains a specific string of text using a true-false comparison. If it passes (true), it will move the data to Business Process A. If it fails (false), it will move the data to Business Process B.
- If invoked, Business Process A will pick up the data and start processing and (whether the task ends or fails) end the initial Business Process.
- If invoked, Business Process B will pick up the data and start processing and (whether the task ends or fails) end the initial Business Process.
Note that the ContainsString task cannot be left to the Pass and Fail column's default next and end entries. Otherwise, the sorting wouldn't work - if the ContainsString is True, it would always go to Business Process A, which is what we want. However, if the ContainString is false, leaving the Fail column as end would just end the business process in error.
Likewise, the Business Process A task's Pass column cannot remain next, or else the process would also kick off Business Process B when we only wanted to send data to a single Business Process.
Comments
0 comments
Please sign in to leave a comment.