1 Reply Latest reply on May 22, 2009 8:55 AM by Ronald van Kuijk

    JBPM : How to open web forms under a process flow

    anurag yadav Newbie

      Hi,

      I am new to JBPM and tried it for some time to build a sample web application based on JBPM work flow. Now as i have different web forms attached with various nodes to take user input but when i am executing the process via java code (not on jbpm-console), the whole process executed simultaneously without opening any web form....
      i had searched a lot over the net but didn't found any way out to open form via jbpm process.. is there any thing else required for this...

      My process definition looks like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="Appraisal">
       <swimlane name="employee">
       <assignment pooled-actors="anuragy,onkars"></assignment>
       </swimlane>
       <swimlane name="RO">
       <assignment pooled-actors="sandeepg,vinayb"></assignment>
       </swimlane>
      
      
       <start-state name="Fill Appraisal Form">
       <task name="Fill Appraisal Form">
       <assignment pooled-actors="anuragy,onkars"></assignment>
       <controller>
       <variable access="read,write" name="ecode" mapped-name="E-Code"></variable>
       <variable access="read,write" name="empName" mapped-name="Emp-Name"></variable>
       <variable access="read,write" name="scheduleAdherence" mapped-name="Schedule Adherence"></variable>
       <variable access="read,write" name="quality" mapped-name="Quality"></variable>
       <variable access="read,write" name="effort" mapped-name="Effort"></variable>
       </controller>
       </task>
      
       <event type="node-leave">
       <action class="com.demo.handler.FillAppraisalFormHandler"></action>
       </event>
       <transition to="Approve Appraisal Form"></transition>
       </start-state>
      
      
       <task-node name="Approve Appraisal Form">
       <task name="Approve Appraisal Form">
       <assignment pooled-actors="sandeepg,vinayb"></assignment>
       <controller>
       <variable access="read" name="ecode" mapped-name="E-Code"></variable>
       <variable access="read" name="empName" mapped-name="Emp-Name"></variable>
       <variable access="read" name="scheduleAdherence" mapped-name="Schedule Adherence"></variable>
       <variable access="read" name="quality" mapped-name="Quality"></variable>
       <variable access="read" name="effort" mapped-name="Effort"></variable>
       <variable access="read,write" name="comment" mapped-name="Comment"></variable>
       </controller>
       </task>
       <event type="node-enter">
       <action class="com.demo.handler.GetAppraisalData"></action>
       </event>
       <transition to="End" name="Approve"></transition>
       <transition to="Update Appraisal Form" name="Reject"></transition>
       </task-node>
      
       <task-node name="Update Appraisal Form">
       <task name="Update Appraisal Form">
       <assignment pooled-actors="anuragy,onkars"></assignment>
       <controller>
       <variable access="read" name="ecode" mapped-name="E-Code"></variable>
       <variable access="read" name="empName" mapped-name="Emp-Name"></variable>
       <variable access="read,write" name="scheduleAdherence" mapped-name="Schedule Adherence"></variable>
       <variable access="read,write" name="quality" mapped-name="Quality"></variable>
       <variable access="read,write" name="effort" mapped-name="Effort"></variable>
       <variable access="read" name="comment" mapped-name="Comment"></variable>
       </controller>
       </task>
       <transition to="Approve Appraisal Form"></transition>
       </task-node>
      
      
       <end-state name="End"></end-state>
      
      
      
      </process-definition>

      and my forms.xml looks like this:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <forms>
       <form task="Fill Appraisal Form" form="Fill Appraisal Form.xhtml"/>
       <form task="Approve Appraisal Form" form="Approve Appraisal Form.xhtml"/>
       <form task="Update Appraisal Form" form="Update Appraisal Form.xhtml"/>
      </forms>
      


      and i am creating any process instance via this way:
      
       public ProcessInstance startNewProcessInstance(String processDefinitionName) {
      
       JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
       try {
       GraphSession graphSession = jbpmContext.getGraphSession();
       ProcessDefinition definition = graphSession
       .findLatestProcessDefinition(processDefinitionName);
       if (definition != null) {
      
       } else {
       definition = deployProcessDefinition(jbpmContext,
       processDefinitionName);
       }
       ProcessInstance instance = definition.createProcessInstance();
       signalProcess(jbpmContext, instance);
       return instance;
       } catch (Exception ex) {
       ex.printStackTrace();
       } finally {
       jbpmContext.close();
       }
       return null;
       }


      Please help!!!!!