3 Replies Latest reply on Jan 30, 2008 6:11 AM by Vitaly Xaoc

    Reference to subprocess definition in process state not set.

    Konstantin Kolev Newbie

      Hi!
      What I have is two process definitions - one main and another that I want to use in a process state of the first one.
      The main definition is:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition xmlns="http://jbpm.org/3/jpdl"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://jbpm.org/3/jpdl http://jbpm.org/xsd/jpdl-3.0.xsd"
       name="budgetPlanningProcess">
       <start-state name="start">
       <transition name="tr1" to="state1"/>
       </start-state>
       <state name="state1">
       <transition name="tr1" to="process state"/>
       </state>
       <process-state name="process state">
       <sub-process name="testProcess"/>
       <transition name="tr1" to="state2"/>
       </process-state>
       <state name="state2">
       <transition name="tr1" to="end1"/>
       </state>
       <end-state name="end1"></end-state>
      </process-definition>
      

      The subprocess definition is:
      <?xml version="1.0" encoding="UTF-8"?>
      <process-definition
       xmlns="http://jbpm.org/3/jpdl" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://jbpm.org/3/jpdl http://jbpm.org/xsd/jpdl-3.0.xsd"
       name="testProcess">
       <start-state name="ss1">
       <transition name="tr1" to="ss2"/>
       </start-state>
       <state name="ss2">
       <transition name="tr1" to="ends"></transition>
       </state>
       <end-state name="ends"/>
      </process-definition>
      

      First of all I deploy the subprocess definition, afterwards the main process definition. Unfortunately the process state of the main process definition does not have a reference to its subprocess set in the database (the subprocessdefinition_ column in Jbpm_Node table is null).
      The documentation suggests me to check the class
      test/java/org/jbpm/graph/exe/ProcessStateTest.java
      for how to use subprocess. I've tryed similar example like setting the subprocess of the process state after deploying the main definition and it's fine.
      But this actually doesn't work for me because I don't know the name of the subprocess in order to fetch it from the database first.
      According to me (and the documentation) the subprocess reference would have been set automatically if the subprocess exists in the database.
      Jbpm developers, please correct me if I am wrong. That would mainly clear the situation.
      Anyone having any experience with certain situation?
      Appreciate any help!

      Regards,
      Saviola