4 Replies Latest reply on Apr 2, 2013 11:07 AM by stangirala

    How to build package in Guvnor with JBPM process that use user data types ?

    cybiks

      I have business process described in bpmn file. It has scriptTasks that use some project types.

       

      <itemDefinition id="_stepItem" structureRef="project.model.Step" />

      <itemDefinition id="_actionsItem" structureRef="java.util.Map" />

       

      <process processType="Private" isExecutable="true" id="com.sample.id" name="EXAMPLE" tns:packageName="defaultPackage" tns:version="1" >

      <extensionElements>
      <tns:import name="project.model.StepAction" />
      <tns:import name="project.model.Step" />
      </extensionElements>

      <!-- process variables -->

          <property id="step" itemSubjectRef="_stepItem"/>

          <property id="actions" itemSubjectRef="_actionsItem"/>

       

      ...

      <scriptTask id="_2" name="1FakedStepAction" scriptFormat="http://www.java.com/java" >

            <script>          

                     try { 

                           ((StepAction)(actions.get("1StepAction"))).executeStepAction((Step)step);  }

                     catch (Exception e) {

                               System.out.println("Exception  1StepAction: "+e);

                     }

               </script>

      </scriptTask>

      ...

      In Java code I put

      Map<String, Object> params = new HashMap<String, Object>();

      params.put("step", <some real instance of Step>);

      params.put("actions", <some actions map like 1StepAction -> real instance of StepAction>);

      ksession.startProcess("com.sample.id", params)

       

      It works fine when I put such file in class path and spring configuration uploads it from this file. I put it to Guvnor. And application successfully load such process from it and run.

      But when I try to build package in Guvnor with such process it complains :

       

      Unable to generate action invoker. project.model.Step cannot be resolved to a type

       

      Process Compilation error project.model.Step cannot be resolved to a type

      StepActioncannot be resolved to a type

       

      So, how Guvnor can access to my types deployed in my project? Is it possible?