コード例 #1
0
 private ActivityInstance complete(ActivityInstance ai, String context, Map<String, ?> data) {
   WorkflowService ws = sf.getWorkflowService();
   if (ai.getState() != ActivityInstanceState.Application) {
     ai = ws.activate(ai.getOID());
   }
   ai = ws.complete(ai.getOID(), context, data);
   return ai;
 }
コード例 #2
0
 @SuppressWarnings("unchecked")
 private List<ActivityInstance> getWorklist(EvaluationPolicy... policies) {
   WorkflowService ws = sf.getWorkflowService();
   WorklistQuery query = WorklistQuery.findCompleteWorklist();
   if (policies != null) {
     for (EvaluationPolicy policy : policies) {
       query.setPolicy(policy);
     }
   }
   Worklist worklist = ws.getWorklist(query);
   return worklist.getCumulatedItems();
 }
コード例 #3
0
 @SuppressWarnings("unchecked")
 private List<ActivityInstance> getWorklist(ProcessInstance pi, EvaluationPolicy... policies) {
   WorkflowService ws = sf.getWorkflowService();
   WorklistQuery query = WorklistQuery.findCompleteWorklist();
   if (policies != null) {
     for (EvaluationPolicy policy : policies) {
       query.setPolicy(policy);
     }
   }
   query.getFilter().add(new ProcessInstanceFilter(pi.getOID(), false));
   Worklist worklist = ws.getWorklist(query);
   return worklist.getCumulatedItems();
 }
コード例 #4
0
 @Test
 public void testListWorkflows() {
   workflowService.listWorkflows(DUMMY_ID, null, null);
   verify(workflowRevisionService, times(1)).listWorkflows(DUMMY_ID, Optional.empty(), null, null);
 }
コード例 #5
0
 @Test
 public void testGetWorkflowMetadata() {
   workflowService.getWorkflowMetadata(DUMMY_ID, DUMMY_ID, Optional.empty());
   verify(workflowRevisionService, times(1))
       .getWorkflow(DUMMY_ID, DUMMY_ID, Optional.empty(), Optional.empty());
 }
コード例 #6
0
 @Test
 public void testCreateWorkflow() {
   workflowService.createWorkflow(DUMMY_ID, null);
   verify(workflowRevisionService, times(1))
       .createWorkflowRevision(DUMMY_ID, Optional.empty(), null);
 }