We have isolated this bug to the following:
When a process node list is loaded, only the nodes where superstate==null 
should be added via the query.  However, the default behavior is to add all 
nodes to the query. 

We have not tested nested superstates, so there still may be a similar issue 
there.

In the example, (details to follow), Hibernate has the following data:
process definition milestone (pid=1)

node start  id=2, pid=1, superstateid=null, index=0
node pending id=3, pid=1, superstateid =null, index=1
node due  id=4, pid=1, superstateid=3, index=0
node tbd  id=5, pid=1, superstateid=3, index=1
node forecasted id=6, pid=1, superstateid=3, index=2
node completed  id=7, pid=1, superstateid=null, index=2
node end  id=8, pid=1, superstateid=null, index=3


With the production 3.1 jbpm, the process defintion oracle query is:
select nodes0_.PROCESSDEFINITION_ as PROCESSD4_1_, nodes0_.ID_ as ID1_1_, 
nodes0_.NODECOLLECTIONINDEX_ as NODECOL14_1_, nodes0_.ID_ as ID1_2_0_, 
nodes0_.NAME_ as NAME3_2_0_, nodes0_.PROCESSDEFINITION_ as PROCESSD4_2_0_, 
nodes0_.ISASYNC_ as ISASYNC5_2_0_, nodes0_.ACTION_ as ACTION6_2_0_, 
nodes0_.SUPERSTATE_ as SUPERSTATE7_2_0_, nodes0_.SUBPROCESSDEFINITION_ as 
SUBPROCE8_2_0_, nodes0_.DECISIONEXPRESSION_ as DECISION9_2_0_, 
nodes0_.DECISIONDELEGATION as DECISIO10_2_0_, nodes0_.SIGNAL_ as SIGNAL11_2_0_, 
nodes0_.CREATETASKS_ as CREATET12_2_0_, nodes0_.ENDTASKS_ as ENDTASKS13_2_0_, 
nodes0_.CLASS_ as CLASS2_2_0_ from JBPM_NODE nodes0_ where 
nodes0_.PROCESSDEFINITION_=1

This returns all 7 rows.  

However, the process definition node list is built incorrectly. The node list 
at index 0 uses the second index 0 (due) node, which is a substate of pending.  
Similarly, index 1 is also corrupted:
node due  id=4, pid=1, superstateid=3, index=0
node tbd  id=5, pid=1, superstateid=3, index=1
node completed  id=7, pid=1, superstateid=null, index=2
node end  id=8, pid=1, superstateid=null, index=3

The correct query from the process defintion should only include those nodes 
that have a superstateid==null.



select nodes0_.PROCESSDEFINITION_ as PROCESSD4_1_, nodes0_.ID_ as ID1_1_, 
nodes0_.NODECOLLECTIONINDEX_ as NODECOL14_1_, nodes0_.ID_ as ID1_2_0_, 
nodes0_.NAME_ as NAME3_2_0_, nodes0_.PROCESSDEFINITION_ as PROCESSD4_2_0_, 
nodes0_.ISASYNC_ as ISASYNC5_2_0_, nodes0_.ACTION_ as ACTION6_2_0_, 
nodes0_.SUPERSTATE_ as SUPERSTATE7_2_0_, nodes0_.SUBPROCESSDEFINITION_ as 
SUBPROCE8_2_0_, nodes0_.DECISIONEXPRESSION_ as DECISION9_2_0_, 
nodes0_.DECISIONDELEGATION as DECISIO10_2_0_, nodes0_.SIGNAL_ as SIGNAL11_2_0_, 
nodes0_.CREATETASKS_ as CREATET12_2_0_, nodes0_.ENDTASKS_ as ENDTASKS13_2_0_, 
nodes0_.CLASS_ as CLASS2_2_0_ from JBPM_NODE nodes0_ where 
nodes0_.PROCESSDEFINITION_=1 and nodes0_.SUPERSTATE_ is null

Here is the XML file for this process definition Note that the xml brackets did 
not show up correctly, so I replaced them with the html version:
<process-definition name="milestone">
<start-state name='start'>
<transition name="create" to='pending' />
</start-state>
<super-state name='pending'>
<state name='due'>
<transition name="late" to="tbd">
</transition>
</state>
<state name='forecasted'>
<transition name="late" to="tbd">
</transition>
</state>
<state name='tbd'>
</state>
<transition name="reset" to='pending' />
<transition name="complete" to='completed' />
<transition name="forecast" to='/pending/forecasted' />
</super-state>
<state name="completed">
<transition name="reset" to="pending" /> 
<transition name="update" to="completed" />
</state>
<end-state name='end'>
</end-state>
</process-definition>

Here is the JUnit test method that runs this file, within a TestCase that 
extends AbstractDbTestCase:

    public void testMsNodeSuperState() throws Exception {
        // create a process definition
        FileInputStream fis = new 
FileInputStream(MilestoneDefinitionPgd.XML_FILE);
        ProcessDefinition processDefinition  = 
ProcessDefinition.parseXmlInputStream(fis); 

        processDefinition = saveAndReload(processDefinition);

        SuperState superState = (SuperState) 
processDefinition.getNode("pending");
        assertNotNull(superState); // fails
        Node node = superState.getNode("due"); 
        assertNotNull(node);
        assertNotNull(superState);
        assertSame(node, superState.getNode("due"));
      }


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3935592#3935592

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3935592


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to