[jboss-jira] [JBoss JIRA] Closed: (JBPM-928) ProcessDefinition.hbm maps Nodes incorrectly

Tom Baeyens (JIRA) jira-events at lists.jboss.org
Thu May 17 04:36:52 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBPM-928?page=all ]

Tom Baeyens closed JBPM-928.
----------------------------

    Fix Version/s:  jBPM jPDL 3.2.1
       Resolution: Done

This is what i added to the release notes:

Known limitation: Persistence of superstates

When persisting superstates, the process definition's nodes collection will be incorrect upon navigating the ProcessDefinition.nodes relation with e.g. getNodes, getNode(String) or the likes. 

The reason is that column PROCESSDEFINITION_ in table JBPM_NODE serves two incompatible purposes. First, it is used for node to process definition reference, which all nodes have. Second, it is used to indicate the relation ProcessDefinition.nodes, which only top level nodes have. 

The simplest fix is described in the resource org/jbpm/graph/def/ProcessDefinition.hbm.xml. One line needs to be replaced. But the schema will change. One column will be added to the schema. Either you need to add this manually or you need to recreate the schema. 

Another option might be to add a where clause to the hibernate mapping. A restriction that specifies that the ProcessDefinition.nodes relation only takes into account the nodes that have no superstate. This might provide a solution without affecting the db, but it is not tested. If you get this to work, please report on the developer forum so that we can include this fix as well. 



Let me know if you would be able to get the second option to work.  That would be better.

> ProcessDefinition.hbm maps Nodes incorrectly
> --------------------------------------------
>
>                 Key: JBPM-928
>                 URL: http://jira.jboss.com/jira/browse/JBPM-928
>             Project: JBoss jBPM
>          Issue Type: Bug
>          Components: Core Engine
>    Affects Versions: jBPM jPDL 3.2,  jBPM 3.1.2
>            Reporter: Britt Miner
>         Assigned To: Tom Baeyens
>             Fix For:  jBPM jPDL 3.2.1
>
>
> Symptom:  processDefinition.findNode(), getNode(), getNodeList(), and getNodesMap() (basically all node related methods on ProcessDefinition) fail to properly find or return all Nodes when SuperStates are present.
> Cause:  Hibernate mapping for ProcessDefinition does not recognize that NODEINDEXCOLLECTION_ on the jbpm_node table may have duplicated values per ProcessDefinition (members of a SuperState comprise a separate node collection in this column) and only picks up the last Node with a given NODEINDEXCOLLECTION_ value.  
> The list-index line is the problem:
>     <list name="nodes" cascade="all">
>       <cache usage="nonstrict-read-write"/>
>       <key column="PROCESSDEFINITION_" />
>       <list-index column="NODECOLLECTIONINDEX_" />
>       <one-to-many class="org.jbpm.graph.def.Node" />
>     </list>
> Solution:  Perhaps usage of a Set instead of a list would solve the problem (Sets don't use 'list-index'), or a Hibernate Bag collection would allow usage of a List in the object without the requirement of list-index (with an associated performance hit).   Or perhaps some type of Hibernate filter could be used.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list