-
1. Re: n-of-m join with jPDL
leobaz2 Jan 12, 2007 3:04 PM (in response to leobaz2)I did some more searching and see that n out of m joins is not directly supported in jpdl yet. However, in the post below, it is mentioned that it is possible with scripting. Can someone please provide an example script to implement n-out-of-m joins?
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=93162&postdays=0&postorder=asc&start=10
Regards,
Barry -
2. Re: n-of-m join with jPDL
leobaz2 Jan 12, 2007 3:47 PM (in response to leobaz2)Here is a join with beanshell that I just created and it looks like it worked. Please let me know if you see any problems with this script.
count = 0;
if(executionContext.getContextInstance().hasVariable("count", token))
{
count = executionContext.getContextInstance().getVariable("count", token);
}
count = count + 1;
if(count == 2)
{
executionContext.leaveNode();
}
else if(count > 2)
{
token.end();
}
executionContext.getContextInstance().setVariable("count",count,token);
Regards,
Barry -
3. Re: n-of-m join with jPDL
leobaz2 Jan 12, 2007 3:49 PM (in response to leobaz2)Here is the script ....
<join name="join1"> <event type="node-enter"> <script> count = 0; if(executionContext.getContextInstance().hasVariable("count", token)) { count = executionContext.getContextInstance().getVariable("count", token); } count = count + 1; if(count == 2) { executionContext.leaveNode(); } else if(count > 2) { token.end(); } executionContext.getContextInstance().setVariable("count",count,token); </script> </event> <transition name="" to="Some task"></transition> </join>