4 Replies Latest reply on Dec 1, 2006 3:24 AM by appendix

    No subprocessId in Node with subprocess

      Hi,

      I'm facing a problem with a process definition which contains a task-node with a sub-process.
      When deploying both processes into a clean database the definitions and nodes are persisted currectly, but when the node with the sub-process is instantiated during the workflow, an exception is thrown stating that a process with a NULL definition cannot be instantiated.

      I had a look at the database and realized that the table jbpm_node has no entry in the column subprocessdefinition_ in the row with the sub-process task despite both processes are correctly deployed to jbpm_processdefinition.

      I looked at the sources and saw that the process definitions are persisted in org.jbpm.db.GraphSession.deployProcessDefinition(). Here both process definitions are saved to the session and the the session. When the session is closed later on, the underlying hibernate cannot refer to the sub-process-id when populating the table jbpm_node.

      If I execute a manual session.flush() after the sub-process definition is saved to the session, then the table jbpm_node is populated correctly with a valid subprocessid_ after all.

      I'm using jbpm-3.1.1 with a postgres 8.1.4 and wonder if this is a known issue. I had a look at the 3.1.2 sources and saw that code for process definition deployment didn't change, so I assume a version upgrade wouldn't solve my problem.

      Any suggestions on using task-nodes with sub-processes? How can i make sure that all sub-processes are refered in their corresponding task nodes correctly? I don't get any warnings or errors at deployment time and the exception is thrown at runtime.
      I haven't included the process definitions in this post, because I'm positive that they are valid and they would only blow up this post.

      Thanks for any help in advance,

      Kurt

        • 1. Re: No subprocessId in Node with subprocess
          koen.aers

          Kurt,

          What exactly do you mean with task node with a subprocess?

          Regards,
          Koen

          • 2. Re: No subprocessId in Node with subprocess

            Hi Koen,

            thank you for your reply and please accept my apologies for mixing up a term. It is indeed not a task node, which cannot hold a sub-process, but a process-state-node as exemplified by the following snippet.

            <process-state name="subProcessStateNode">
             <sub-process name="childProcessName"></sub-process>
             <transition to="nextNode"></transition>
            </process-state>
            


            The child as well as the parent process are persisted to the database, but the column _subprocessdefinition in the table jbpm_node doesn't hold a valid entry for the node "subProcessStateNode".

            Regards, Kurt

            Regards, Kurt

            • 3. Re: No subprocessId in Node with subprocess
              jainer

              Kurt:

              You must deploy first the subprocess and later deploy the process, i did it and work it fine.

              jainer e.

              • 4. Re: No subprocessId in Node with subprocess

                Hi Jainner,

                I thought about that as well - and it would make sense, but I'm doing that already.
                I'm using the ant deploy task:

                <target name="deploy-process-definition">
                 <taskdef name="deploypar" classpathref="ant.classpath" classname="org.jbpm.ant.DeployProcessTask">
                 </taskdef>
                 <deploypar cfg="resources/hibernate_ant.cfg.xml">
                 <fileset id="processDefinition" dir="resources/processDefinition">
                 <include name="subProcess.par" /> <!-- is referenced by the later -->
                 <include name="superProcess.par" />
                 </fileset>
                 </deploypar>
                </target>
                


                Additionally I was using Seam build-in process deployment mechanism, but it lead to the same issues.

                Is there a better way of deploying process descriptions without using ant?

                Regards, Kurt