Package org.activiti.engine

Examples of org.activiti.engine.TaskService.complete()


    taskService.claim(approveCriticalIssueTask.getId(), itguy.getId());

    // approve the request and complete the task
    Map<String, Object> taskParams = new HashMap<String, Object>();
    taskParams.put("requestApproved", "true");
    taskService.complete(approveCriticalIssueTask.getId(), taskParams);

    // now we should have received an email..
    smtpServer.waitForIncomingEmail(5000L, 1);
    MimeMessage[] messages = smtpServer.getReceivedMessages();
    assertThat(messages.length, equalTo(1));
View Full Code Here


   
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("approved", true);
   
    Task task = taskService.createTaskQuery().singleResult();
    taskService.complete(task.getId(), variables);
   
    assertEquals(0, runtimeService.createProcessInstanceQuery().list().size());
   
    List<HistoricActivityInstance> activityInstances = historyService.createHistoricActivityInstanceQuery().orderByHistoricActivityInstanceStartTime().asc().list();
    assertEquals(7, activityInstances.size());
View Full Code Here

   
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("approved", false);
   
    Task task = taskService.createTaskQuery().singleResult();
    taskService.complete(task.getId(), variables);
   
    assertEquals(0, runtimeService.createProcessInstanceQuery().list().size());
   
    List<HistoricActivityInstance> activityInstances = historyService.createHistoricActivityInstanceQuery().orderByHistoricActivityInstanceStartTime().asc().list();
    assertEquals(7, activityInstances.size());
View Full Code Here

   
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("approved", true);
   
    Task task = taskService.createTaskQuery().singleResult();
    taskService.complete(task.getId(), variables);
   
    assertEquals(0, runtimeService.createProcessInstanceQuery().list().size());
   
    List<HistoricActivityInstance> activityInstances = historyService.createHistoricActivityInstanceQuery().orderByHistoricActivityInstanceStartTime().asc().list();
    assertEquals(7, activityInstances.size());
View Full Code Here

   
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("approved", false);
   
    Task task = taskService.createTaskQuery().singleResult();
    taskService.complete(task.getId(), variables);
   
    assertEquals(0, runtimeService.createProcessInstanceQuery().list().size());
   
    List<HistoricActivityInstance> activityInstances = historyService.createHistoricActivityInstanceQuery().orderByHistoricActivityInstanceStartTime().asc().list();
    assertEquals(7, activityInstances.size());
View Full Code Here

    Calendar ca = Calendar.getInstance();
    ca.add(Calendar.SECOND, 5);
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    SimpleDateFormat sdft = new SimpleDateFormat("HH:mm:ss");
    properties.put("dateTime", sdf.format(ca.getTime()) + "T" + sdft.format(ca.getTime()));
    taskService.complete(task.getId(), properties);
  }
 
  public void startProcessWithJob() throws Exception {
    ProcessEngineConfiguration createStandaloneInMemProcessEngineConfiguration = StandaloneInMemProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();
    createStandaloneInMemProcessEngineConfiguration.setJobExecutorActivate(true);
View Full Code Here

    Calendar ca = Calendar.getInstance();
    ca.add(Calendar.SECOND, 1);
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    SimpleDateFormat sdft = new SimpleDateFormat("HH:mm:ss");
    properties.put("dateTime", sdf.format(ca.getTime()) + "T" + sdft.format(ca.getTime()));
    taskService.complete(task.getId(), properties);
    Thread.sleep(2000);
    System.exit(0);
  }
 
  public static void main(String[] args) throws Exception {
View Full Code Here

    Task singleResult = taskService.createTaskQuery().taskCandidateUser("henryyan").singleResult();
    String url = "http://labs.mop.com/apache-mirror//ant/binaries/apache-ant-1.8.3-bin.zip";
    String attachmentDescription = "ant bin package";
    taskService.createAttachment("zip", singleResult.getId(), processInstance.getId(), "apache-ant-1.8.3-bin.zip", attachmentDescription, url);
    taskService.complete(singleResult.getId());

    List<Attachment> taskAttachments = taskService.getTaskAttachments(singleResult.getId());
    assertEquals(1, taskAttachments.size());

    HistoryService historyService = activitiRule.getHistoryService();
View Full Code Here

    assertNotNull(taskService.createTaskQuery().taskCandidateUser("henryyan").singleResult());
    assertNotNull(taskService.createTaskQuery().taskCandidateUser("kafeitu").singleResult());

    Task singleResult = taskService.createTaskQuery().taskCandidateUser("henryyan").singleResult();
    taskService.complete(singleResult.getId());

    assertNull(taskService.createTaskQuery().taskCandidateUser("henryyan").singleResult());
    assertNull(taskService.createTaskQuery().taskCandidateUser("kafeitu").singleResult());
  }
View Full Code Here

    taskService.addCandidateUser(taskId, "runtimeUser");

    assertNotNull(taskService.createTaskQuery().taskCandidateUser("runtimeUser").singleResult());

    Task singleResult = taskService.createTaskQuery().taskCandidateUser("henryyan").singleResult();
    taskService.complete(singleResult.getId());

    assertNull(taskService.createTaskQuery().taskCandidateUser("henryyan").singleResult());
    assertNull(taskService.createTaskQuery().taskCandidateUser("kafeitu").singleResult());
  }
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.