[jboss-jira] [JBoss JIRA] Commented: (JBPM-962) SuperState.nodes Mapping causes serious problems

Olga Ivanova (JIRA) jira-events at lists.jboss.org
Wed Jun 13 07:23:11 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBPM-962?page=comments#action_12365181 ] 
            
Olga Ivanova commented on JBPM-962:
-----------------------------------

Could you please review another possible solution to the problem. 
Hibernate mapping for ProcessDefinition could be changed, so it does not return super state nodes by applying where condition to list of nodes.
This change does not affect schema and as I can see it completely solves the problem.

<hibernate-mapping auto-import="false" default-access="field">
  <class name="org.jbpm.graph.def.ProcessDefinition" 
.......
    <list name="nodes" cascade="all" where="SUPERSTATE_ is null">
      <cache usage="nonstrict-read-write"/>
      <key column="PROCESSDEFINITION_" />
      <list-index column="NODECOLLECTIONINDEX_" />
      <one-to-many class="org.jbpm.graph.def.Node" />
    </list>
----
  </class>
</hibernate-mapping>


> SuperState.nodes Mapping causes serious problems
> ------------------------------------------------
>
>                 Key: JBPM-962
>                 URL: http://jira.jboss.com/jira/browse/JBPM-962
>             Project: JBoss jBPM
>          Issue Type: Bug
>          Components: Core Engine
>    Affects Versions: jBPM jPDL 3.2
>            Reporter: Bernd Ruecker
>         Assigned To: Tom Baeyens
>             Fix For: jBPM 3.3
>
>
> The SuperState Node mapping in the database has a problem.
> When parsing a process, everything is done fine. All Nodes at the root level are added to the nodes-association at the process-definition and the nodes in the super-state are added to the super-state nodes.
> But after persisting we have a problem: For every Node the processDefinition-association is set (by JpdlXmlReader.readNodes). So we have a id in every database column for PROCESSDEFINITION_. 
> Because of the many-to-one mapping in ProcessDefinition:
>     <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>
> we now load ALL nodes in the nodes-List in ProcessDefinition (instead of only root nodes). To make things worse, because of the NODECOLLECTIONINDEX_ overlapping with SuperState-Nodes, we only get some of the nodes (I think it is somehow random which ones).
> Took some minutes to catch that ;-)
> One possible fix would be to NOT set the processDefinition for SuperState-Nodes (not my favorite) or maybe improve the mapping to reflect the situation (sorry, there my hibernate expertise ends).

-- 
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