[jboss-user] [jBPM] - Prevent duplication in XOR gateway

Erik Pragt do-not-reply at jboss.com
Mon Jul 30 10:51:40 EDT 2012


Erik Pragt [https://community.jboss.org/people/bodiam] created the discussion

"Prevent duplication in XOR gateway"

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

--------------------------------------------------------------
Hi all,

I'm just getting started with jBPM, and I have a small question about XOR gateways. At the moment, our nodes have two endpoints, and the code for one endpoint looks like this:

switch(result) {
          case OK:
                    return true;  
          default:
                   return false;
}
 


While for the other endpoint (pointing to an 'end event'), it looks like this:


switch(result) {
          case OK:
                    return false;  
          default:
                   return true;
}
 
 


So in the other constraint it's the other way around. To me, this looks like a bit of duplication, and in this example it's not too bad, but in more complex examples, it's trickier. So I was wondering, isn't there a better way to do this? Isn't it possible to create one piece of code, and let true go to one sequence flow, and false to the other, without having the need to duplicate the code? Is something like this possible??

Thanks for the help,

Kind regards, 

Erik
--------------------------------------------------------------

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

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/20120730/f1921b14/attachment.html 


More information about the jboss-user mailing list