Examples of TaskInstance


Examples of org.jbpm.taskmgmt.exe.TaskInstance

    assertEquals(20, jbpmContext.getTaskList("johndoe").size());
  }

  public void testPooledTasklistEagerLoading() {
    for (int i=0; i<20; i++) {
      TaskInstance taskInstance = new TaskInstance("group task "+i);
      taskInstance.setPooledActors(new String[]{"group"+i});
      session.save(taskInstance);
    }
    for (int i=0; i<20; i++) {
      TaskInstance taskInstance = new TaskInstance("task "+i);
      taskInstance.setPooledActors(new String[]{"johndoe", "bachelors", "partyanimals", "wildwomen"});
      session.save(taskInstance);
    }
    newTransaction();
   
    List actorIds = new ArrayList();
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

    // database with the methods in the org.jbpm.db.TaskMgmtSession.
    // Since we don't want to include the persistence complexity in
    // this example, we just take the first task-instance of this
    // process instance (we know there is only one in this test
    // scenario.
    TaskInstance taskInstance = (TaskInstance
        processInstance
          .getTaskMgmtInstance()
          .getTaskInstances()
          .iterator().next();

    // Now, we check if the taskInstance was actually assigned to 'papa'.
    assertEquals("papa", taskInstance.getActorId() );
   
    // Now suppose that 'papa' has done his duties and marks the task
    // as done.
    taskInstance.end();
    // Since this was the last (only) task to do, the completion of this
    // task triggered the continuation of the process instance execution.
   
    assertSame(processDefinition.getNode("end"), token.getNode());
  }
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

    assertEquals("result of myMethod", result);
    assertEquals(1, myMethodInvocationCount);
  }
 
  public void testTaskInstanceName() throws Exception {
    TaskInstance taskInstance = new TaskInstance("hallo");
    executionContext.setTaskInstance(taskInstance);

    String expression = "#{taskInstance.name}";
    Object result = JbpmExpressionEvaluator.evaluate(expression, executionContext);
    assertEquals("hallo", result);
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

    Object result = JbpmExpressionEvaluator.evaluate(expression, executionContext);
    assertEquals("hallo", result);
  }

  public void testTaskInstanceVariable() throws Exception {
    TaskInstance taskInstance = new TaskInstance("hallo");
    taskInstance.setVariableLocally("expectedNbrOfHours", new Float(5.5));
    executionContext.setTaskInstance(taskInstance);
   
    String expression = "#{taskInstance.variables['expectedNbrOfHours']}";
    Object result = JbpmExpressionEvaluator.evaluate(expression, executionContext);
    assertEquals(new Float(5.5), result);
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

    Object result = JbpmExpressionEvaluator.evaluate(expression, executionContext);
    assertEquals(new Float(5.5), result);
  }

  public void testPieceOfText() throws Exception {
    TaskInstance taskInstance = new TaskInstance("hallo");
    taskInstance.setVariableLocally("expectedNbrOfHours", new Float(5.5));

    String expression = "a, b, cdefg";
    Object result = JbpmExpressionEvaluator.evaluate(expression, executionContext);
    assertEquals("a, b, cdefg", result);
  }
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

      "    <property name='actorId'><string>theotherguy</string></property>" +
      "  </bean>" +
      "</beans>"
    );

    TaskInstance taskInstance = (TaskInstance) objectFactory.createObject("task");
    assertEquals("do dishes", taskInstance.getName());
    assertEquals("theotherguy", taskInstance.getActorId());
  }
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

      "    </constructor>" +
      "  </bean>" +
      "</beans>"
    );

    TaskInstance taskInstance = (TaskInstance) objectFactory.createObject("task");
    assertEquals("do dishes", taskInstance.getName());
    assertEquals("theotherguy", taskInstance.getActorId());
  }
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

    assertSame(c, token.getNode());
  }

  public static void endOneTask(Token token) {
    TaskMgmtInstance tmi = (TaskMgmtInstance)token.getProcessInstance().getInstance(TaskMgmtInstance.class);
    TaskInstance taskInstance = (TaskInstance) tmi.getUnfinishedTasks(token).iterator().next();
    taskInstance.end();
  }
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

   * selects a task.
   */
  public String selectTaskInstance() {
    // Get the task instance id from request parameter
    long taskInstanceId = JsfHelper.getId("taskInstanceId");
    TaskInstance taskInstance = taskMgmtSession.loadTaskInstance(taskInstanceId);
    taskBean.initialize(taskInstance);
    return "task";
  }
View Full Code Here

Examples of org.jbpm.taskmgmt.exe.TaskInstance

    // create a new process instance to run
    ProcessInstance processInstance = new ProcessInstance(processDefinition);

    // create a new taskinstance for the start task
    TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();

    // Save the process instance along with the task instance
    jbpmContext.save(processInstance);
   
    // Fill the task backing bean with useful information
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.