2 Replies Latest reply on Jan 30, 2006 2:11 PM by Fred Muhlenberg

    Failure loading process definition

    Fred Muhlenberg Newbie

      I have run into a curious issue when loading a process definition using JpdlXmlReader.

      The Eclipse plugin generates a process definition where the XML (generally) looks like this:

      <?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="AdministrativeData">
       <start-state name="start">
       <transition name="tr1" to="SaveXMLDocument"></transition>
       </start-state>
       <end-state name="end"></end-state>
       <node name="SaveXMLDocument">
       <transition name="tr1" to="end"></transition>
       <action class="workflow.action.SaveXMLDocument" config-type="bean"></action>
       </node>
      </process-definition>
      


      I get an exception when loading the above definition using this code:

       FileReader rdr = new FileReader(...);
       JpdlXmlReader jrdr = new JpdlXmlReader( rdr );
       ProcessDefinition pd = jrdr.getProcessDefinition();
       jbpms.getGraphSession().saveProcessDefinition(pd);
      


      However, if I either remove the XML schema information
      <?xml version="1.0" encoding="UTF-8"?>
      
      <process-definition
       name="AdministrativeData">
       <start-state name="start">
       <transition name="tr1" to="SaveXMLDocument"></transition>
       </start-state>
       <end-state name="end"></end-state>
       <node name="SaveXMLDocument">
       <transition name="tr1" to="end"></transition>
       <action class="workflow.action.SaveXMLDocument" config-type="bean"></action>
       </node>
      </process-definition>
      


      -or-
      adjust the action tag ordering within the node
      <?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="AdministrativeData">
       <start-state name="start">
       <transition name="tr1" to="SaveXMLDocument"></transition>
       </start-state>
       <end-state name="end"></end-state>
       <node name="SaveXMLDocument">
       <action class="workflow.action.SaveXMLDocument" config-type="bean"></action>
       <transition name="tr1" to="end"></transition>
       </node>
      </process-definition>
      


      the process definition is accepted without complaint.