Example 2
This conditional transition example does the following:
- If a ChangeProduct action is taken on a record, it is sent for edit approval (to the users authorized to approve record modifications).
- If a DeleteRecord action is taken on a record, it is sent for delete approval.
<Rule> <Parameter name="action" type="string" eval="xpath" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogA ctionDetails/CatalogItem[LineNumber=1]/ActionCode/Code/Normal/text()" direction="in">workDoc</Parameter> <Parameter name="result" type="boolean" direction="out" /> <Condition format="bsh"> <![CDATA[ result = (action != null) && action.equalsIgnoreCase("ChangeProduct") ; System.out.println("In transition from MoveToFirst to InternalApprovalWorkItemModify:"+result); </Condition> </Rule> <Rule> <Parameter name="action" type="string" eval="xpath" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogA ctionDetails/CatalogItem[LineNumber=1]/ActionCode/Code/Normal/text()" direction="in">workDoc</Parameter> <Parameter name="result" type="boolean" direction="out" /> <Condition format="bsh"> <![CDATA[ result = (action != null) && action.equalsIgnoreCase("DeleteProduct") ; System.out.println("In transition from MoveToFirst to InternalApprovalWorkItemDelete:"+result); </Condition> </Rule>
Copyright © Cloud Software Group, Inc. All rights reserved.