1 Reply Latest reply on Aug 30, 2010 4:10 AM by metku

    Assign task in jBPM

    metku

      Hi, I am new to jBPM implementation, right now im having problem assigning task and start the task. Below are code snippet that will trigger the assign task. Basically i want to assign the actor to the task base on the task id and clears the pooled actors (this is to make sure only one person are doing the task).

       

       

      JbpmContext jbpmContext = null;
              
               try{        
                      JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
                      
                      jbpmContext = jbpmConfiguration.createJbpmContext();
              
                      TaskInstance taskInstance =  jbpmContext.getTaskInstance(62); // Hardcoded Instance Id
                      taskInstance.setActorId("82123111245");
                      taskInstance.start();
      
                      List<String> userIds = new ArrayList<String>();
                      taskInstance.setPooledActors((String[])userIds.toArray(new String[0]));
                      
                      jbpmContext.save(taskInstance);
               }catch(JbpmPersistenceException ex){
                      System.out.println("-@Claim Task--Actor not found--");
               }
      

       

      But right now there're nothing happening over the jBPM Console. The task is still not assigned ,started and there are no errors on the server log.

       

      Many thanks in advance.

        • 1. Re: Assign task in jBPM
          metku

          Managed to solve it. Apparently the whole process wont 'move' unless you close it. So a simple close portion goes a long way.

           

           

          finally{ 
               if(jbpmContext != null)
                    jbpmContext.close();
          }