[jboss-user] [jBPM] - Created workflow definition programmatically - How to assign variables to switch on SplitNode?

pras mn do-not-reply at jboss.com
Wed May 22 15:39:53 EDT 2013


pras mn [https://community.jboss.org/people/bloreguy] created the discussion

"Created workflow definition programmatically - How to assign variables to switch on SplitNode?"

To view the discussion, visit: https://community.jboss.org/message/818953#818953

--------------------------------------------------------------
I am creating a workflow definition programmatically and am able to invoke the workflow and execute any action nodes and work item nodes ( which in turn calls a WorkItemHandler). However I am stuck in transitioning outaide of a SplitNode.

I have a HumanTaskNode assigned to a user. When the user approves or rejects an order, I have a split node which will redirect to 2 different nodes. The constraint I have added for the SplitNode is as follows:

SplitFactory splitFactory = factory.splitNode( 1000)
                .type(Split.TYPE_XOR)
                .name("SplitNode");


    splitFactory.constraint(2000, "orderApproved?", "code","java","return !orderApproved").done();
    splitFactory.constraint(2500, "orderApproved?", "code","java","return orderApproved).done();

My question is how do we set the value of orderApproved at runtime so that the SplitNode can redirect to either node 2000 or node 2500? Should it be done in a WorkItemHandler? If So, what needs to be passed in to the workitem handler and how to read the value of the orderApproved back ?

I receive the value of the orderApproved via a web service call and need to assign it to the process variable "orderApproved". Any assistance with code samples or pointers will be greatly appreciated

orderApproved is declared earlier as 

factory
            .name("name")
                .packageName(workflow.getName("name")                
                .variable("orderApproved",new ObjectDataType(Boolean.class.getCanonicalName()))
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/818953#818953]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130522/6da63026/attachment.html 


More information about the jboss-user mailing list