0 Replies Latest reply on May 3, 2014 1:49 PM by some.hal123

    task creating issue in JBPM6

    some.hal123

      Hi,

       

      I have created a new Project like 'Evaluation' in Eclipse Kepler.

       

      But when I am running this in jUnitRuntime I am getting exception in the following line:

       

      assertEquals(1, tasks.size());

       

      Because tasksize I am getting zero.

       

      I am pasting my code below :

       

      public class ProcessTest extends JbpmJUnitBaseTestCase {

       

          @Test

          public void testProcess() throws MalformedURLException {

             

              try {

        

              RuntimeManager manager = createRuntimeManager("

      Evaluation.bpmn");
              RuntimeEngine engine = getRuntimeEngine(null);
                     
               KieSession ksession = engine.getKieSession();
              
              KieRuntimeLogger log = KieServices.Factory.get().getLoggers().newThreadedFileLogger(ksession, "test", 1000);
             
              TaskService taskService = engine.getTaskService();
             
               // start a new process instance
              Map<String, Object> params = new HashMap<String, Object>();
              params.put("employee", "krisv");
              params.put("reason", "Yearly performance evaluation");
               ProcessInstance processInstance =
              ksession.startProcess("com.sample.evaluation", params);
              //ksession.startProcess("evaluation", params);
                     
              //ksession.startProcess("com.sample.evaluation");
                      
              System.out.println("Process started ...");
             
              //assertProcessInstanceCompleted(processInstance.getId(), ksession);
             
              // complete Self Evaluation
               List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("krisv", "en-UK");  --getting zero task in this line
              assertEquals(1, tasks.size()); ----Getting exception in this line because task size is zero but it should be 1
              TaskSummary task = tasks.get(0);
              System.out.println("'krisv' completing task " + task.getName() + ": " + task.getDescription());
               taskService.start(task.getId(), "krisv");
              Map<String, Object> results = new HashMap<String, Object>();
              results.put("performance", "exceeding");
              taskService.complete(task.getId(), "krisv", results);
              
              // john from HR
              tasks = taskService.getTasksAssignedAsPotentialOwner("john", "en-UK");
              assertEquals(0, tasks.size());
              task = tasks.get(0);
              System.out.println("'john' completing task " + task.getName() + ": " + task.getDescription());
               taskService.claim(task.getId(), "john");
              taskService.start(task.getId(), "john");
              results = new HashMap<String, Object>();
              results.put("performance", "acceptable");
               taskService.complete(task.getId(), "john", results);
             
              // mary from PM
              tasks = taskService.getTasksAssignedAsPotentialOwner("mary", "en-UK");
              assertEquals(1, tasks.size());
               task = tasks.get(0);
              System.out.println("'mary' completing task " + task.getName() + ": " + task.getDescription());
              taskService.claim(task.getId(), "mary");
               taskService.start(task.getId(), "mary");
              results = new HashMap<String, Object>();
              results.put("performance", "outstanding");
              taskService.complete(task.getId(), "mary", results);
              
              assertProcessInstanceCompleted(processInstance.getId(), ksession);
              System.out.println("Process instance completed");
              log.close();
             
              manager.disposeRuntimeEngine(engine);
               manager.close();
              }
              catch (Throwable t) {
                  t.printStackTrace();
              }
              System.exit(0);
          }
         
          public ProcessTest() {
              super(true, false,"org.jbpm.persistence.jpa.updated");
           }

       

       

      Please help me to fix the issue.

       

      Also I want to communicate the JBPM Project with external ASP.NET Web Application without using ESB. I am thinking to use Web service.

       

      Is there any link for sample project or Article regrading the communication of JBPM Project with ASP.NET Application using web Service?

       

      Please give me some idea how to communicate to disparate system without using ESB.

       

      Looking for help as soon as possible.

       

      Thanks and Regards,

      Somehal