[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-3107) Jbpm.installPageflowDefinitions() changes order of pageflowDefinitions

Wolfgang Schwendt (JIRA) jira-events at lists.jboss.org
Thu Jun 12 18:44:34 EDT 2008


    [ http://jira.jboss.com/jira/browse/JBSEAM-3107?page=comments#action_12416924 ] 
            
Wolfgang Schwendt commented on JBSEAM-3107:
-------------------------------------------

Using an Arraylist is a simple ad hoc fix, but not the correct solution either.   I have not analyzed what the DeploymentHandler exactly does,  but I understand that you intend to merge  two definition lists: 

mergedPageflowDefinitions.addAll(((PageflowDeploymentHandler) ((DeploymentStrategy) Contexts.getEventContext().get(StandardDeploymentStrategy.NAME)).getDeploymentHandlers().get(PageflowDeploymentHandler.NAME)).getPageflowDefinitions());

and

mergedPageflowDefinitions.addAll(Arrays.asList(pageflowDefinitions));


When using an ArrayList, there would be no merge effect, the  second definition would simply be appended to the the first list of definitions.     So this needs to be completely reimplemented, but with a merge that preserves the order of pageflows specified via components.xml /  void setPageflowDefinitions(String[] pageflowDefinitions).

As noted above, without the pageflow definition order being preserved, the subpageflow feature is not usable.  Therefore the bug is a Blocker.

> Jbpm.installPageflowDefinitions() changes order of pageflowDefinitions
> ----------------------------------------------------------------------
>
>                 Key: JBSEAM-3107
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-3107
>             Project: Seam
>          Issue Type: Bug
>         Environment: Seam 2.1 SVN trunk
>            Reporter: Wolfgang Schwendt
>            Priority: Blocker
>             Fix For: 2.1.0.BETA2
>
>
> current code in Seam 2.1. SVN-based trunk:
> org.jboss.seam.bpm.Jbpm 
> private void installPageflowDefinitions() {
>       Set<String> mergedPageflowDefinitions = new TreeSet<String>();
> Set semantics is wrong here.  In order to fix the bug described below, please change to 
>      ArrayList<String> mergedPageflowDefinitions = new ArrayList<String>();
>   
> Reason:
> when jPDL tries to parse pageflow  with a <process-state> that calls a sub pageflow via a <sub-process name="subpageflow"/> child element,   it can only parse the process-state if the subpageflow was parsed already.   See org.jbpm.graph.node.ProcessState.read().   If the subpageflow was NOT parsed already before the <process state> of the parent pageflow gets parsed, jBPM's  SubProcessResolver throws a null pointer exception (NPE).  Hence, to avoid a NPE,   we have have to list  all included pageflows in a partial order in components.xml:    The pageflows first listed are the included subpageflows,  the pageflows  listed last are the parent pageflows which call the preceding subpageflows. 
> Now, if installPageflowDefinitions() puts the names of these pageflow definition files in a set (rather than list), the order gets lost and in turn the likelihood increases that jBPM's SubProcessResolver throws a null pointer exception.
>  <!--Pageflow definition  in a special order with subpageflows listed first ->
>  <bpm:jbpm>
>       <bpm:process-definitions></bpm:process-definitions>
>       <bpm:pageflow-definitions> 
>          <value>/WEB-INF/benutzerKontoEroeffnen.jpdl.xml</value>   
>          <value>/WEB-INF/beimSystemAnmelden.jpdl.xml</value>
>          <value>/WEB-INF/beimSystemAnmeldenTopLevel.jpdl.xml</value>
>          <value>/WEB-INF/aufWartelisteSetzen.jpdl.xml</value>         
>          <value>/WEB-INF/persoenlicheDatenBearbeiten.jpdl.xml</value>
>          <value>/WEB-INF/zumSeminarAnmelden.jpdl.xml</value>        
>          <value>/WEB-INF/seminarSuche.jpdl.xml</value>
>          <value>/WEB-INF/seminardatenBearbeiten.jpdl.xml</value>
>          <value>/WEB-INF/seminarbelegungenEinsehen.jpdl.xml</value>
>       </bpm:pageflow-definitions>
>    </bpm:jbpm>

-- 
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 seam-issues mailing list