Examples of TaskService


Examples of org.apache.agila.services.task.TaskService

        context.setTimerService(ts);
        assertEquals(ts, context.getTimerService());
    }

    public void testTaskService() {
        TaskService tskServ = new TaskServiceImpl();
        context.setTaskService(tskServ);
        assertEquals(tskServ,context.getTaskService());
    }
View Full Code Here

Examples of org.apache.agila.services.task.TaskService

    }

    protected void setUp() throws Exception {
        super.setUp();
        TimerService ts = new TimerServiceImpl();
        TaskService tskServ = new TaskServiceImpl();
        NotificationService notifyService = new NotificationServiceImpl();

        node = new HelloWorldActivity();

        node.addBinding(new Binding("cheese", "edam", Binding.STATIC, true, true));
View Full Code Here

Examples of org.apache.agila.services.task.TaskService

         */

        TokenService tokenService = new TokenServiceImpl();
        InstanceService eiSvc = new InstanceServiceImpl();
        BusinessProcessServiceImpl graphManager = new BusinessProcessServiceImpl();
        TaskService taskService = new TaskServiceImpl();
        TimerServiceImpl timerService = new TimerServiceImpl();

        MessageProcessor impl = new MessageProcessor();

        impl.setTaskService(taskService);
        impl.setTimerService(timerService);
        impl.setExecutionInstanceService(eiSvc);
        impl.setTokenService(tokenService);
        impl.setBusinessProcessService(graphManager);

        QueueServiceImpl qs = new QueueServiceImpl(impl);

        timerService.setQueueService(qs);

        impl.setQueueService(qs);

        /*
         * now start the message pump for processing since we are all ready
         */

        qs.start();

        Engine engine = new Engine(tokenService, eiSvc, graphManager, qs);

        System.out.println("STARTING AN INSTANCE");

        HashMap m = new HashMap();

        m.put("foo", "foo value");

        FileReader reader = null;
        try {
            reader = new FileReader(new File("workflow_simple.xml"));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }


//        engine.addBusinessProcess(reader);

        engine.startNewInstance(1, m);

        while(true) {

            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

            while(true){

                System.out.print("> ");

                String line = br.readLine();

                System.out.println("--->" + line);

                if (line.startsWith("n ")) {
                    String s = line.substring("n ".length());

                    System.out.println("nudging token id = " + s);
                    engine.nudge(new TokenID(Integer.parseInt(s)));
                }
                else
                    if (line.startsWith("t")){
                        List l =  taskService.getTasksForUser(new UserID(1), Task.TASK_INCOMPLETE);

                        Iterator it = l.iterator();

                        while(it.hasNext()) {
                            Task task = (Task) it.next();
View Full Code Here

Examples of org.apache.agila.services.task.TaskService

*/
public class TestTaskNode extends BaseNodeImpl implements TaskActivity {

    public boolean doStart(NodeContext ctx) {

        TaskService ts = ctx.getTaskService();

        ts.assignTask(ctx.getNextExecutionToken().getTokenID(), "Approve site visit",
                new UserID(1), new Date());

        return false;
    }
View Full Code Here

Examples of org.apache.agila.services.task.TaskService

public class LeaveApprovalTask extends BaseNodeImpl implements TaskActivity {

    public boolean doStart(NodeContext ctx) {

        TaskService ts = ctx.getTaskService();
        NotificationService ns = ctx.getNotificationService();

        ts.assignTask(ctx.getNextExecutionToken().getTokenID(), "Leave Approval",
                new UserID(1), new Date());

        return false;
    }
View Full Code Here

Examples of org.apache.agila.services.task.TaskService

     * @param ctx
     * @return
     */
    public boolean doStart(NodeContext ctx) {

        TaskService ts = ctx.getTaskService();

        ts.assignTask(ctx.getNextExecutionToken().getTokenID(), "Enter leave details",
                new UserID(1), new Date());

        return false;
    }
View Full Code Here

Examples of org.camunda.bpm.engine.TaskService

  }

  private void mockServices(ProcessEngine engine) {
    RepositoryService repoService = mock(RepositoryService.class);
    IdentityService identityService = mock(IdentityService.class);
    TaskService taskService = mock(TaskService.class);
    RuntimeService runtimeService = mock(RuntimeService.class);
    FormService formService = mock(FormService.class);
    HistoryService historyService = mock(HistoryService.class);
    ManagementService managementService = mock(ManagementService.class);
    CaseService caseService = mock(CaseService.class);
View Full Code Here

Examples of org.camunda.bpm.engine.TaskService

       .singleResult();
    
     assertNotNull(processInstance);
    
     // Complete the task.  That will end the process instance
     TaskService taskService = processEngine.getTaskService();
     Task task = taskService
       .createTaskQuery()
       .list()
       .get(0);
     taskService.complete(task.getId());
    
     // Check if the process instance has really ended.  This means that the process definition has
     // re-loaded into the process definition cache
     processInstance = processEngine
       .getRuntimeService()
View Full Code Here

Examples of org.camunda.bpm.engine.TaskService

      .setJdbcUrl("jdbc:h2:mem:activiti-process-cache-test;DB_CLOSE_DELAY=1000")
      .setJobExecutorActivate(false)
      .buildProcessEngine();
    RepositoryService repositoryService2 = processEngine2.getRepositoryService();
    RuntimeService runtimeService2 = processEngine2.getRuntimeService();
    TaskService taskService2 = processEngine2.getTaskService();
   
    // Deploy first version of process: start->originalTask->end on first process engine
    String deploymentId = repositoryService1.createDeployment()
      .addClasspathResource("org/camunda/bpm/engine/test/cache/originalProcess.bpmn20.xml")
      .deploy()
      .getId();
   
    // Start process instance on second engine
    String processDefinitionId = repositoryService2.createProcessDefinitionQuery().singleResult().getId();
    runtimeService2.startProcessInstanceById(processDefinitionId);
    Task task = taskService2.createTaskQuery().singleResult();
    assertEquals("original task", task.getName());
   
    // Delete the deployment on second process engine
    repositoryService2.deleteDeployment(deploymentId, true);
    assertEquals(0, repositoryService2.createDeploymentQuery().count());
    assertEquals(0, runtimeService2.createProcessInstanceQuery().count());
   
    // deploy a revised version of the process: start->revisedTask->end on first process engine
    //
    // Before the bugfix, this would set the cache on the first process engine,
    // but the second process engine still has the original process definition in his cache.
    // Since there is a deployment delete in between, the new generated process definition id is the same
    // as in the original deployment, making the second process engine using the old cached process definition.
    deploymentId = repositoryService1.createDeployment()
      .addClasspathResource("org/camunda/bpm/engine/test/cache/revisedProcess.bpmn20.xml")
      .deploy()
      .getId();
   
    // Start process instance on second process engine -> must use revised process definition
    processDefinitionId = repositoryService2.createProcessDefinitionQuery().singleResult().getId();
    runtimeService2.startProcessInstanceByKey("oneTaskProcess");
    task = taskService2.createTaskQuery().singleResult();
    assertEquals("revised task", task.getName());
   
    // cleanup
    repositoryService1.deleteDeployment(deploymentId, true);
    processEngine1.close();
View Full Code Here

Examples of org.camunda.bpm.engine.TaskService

    this.objectMapper = objectMapper;
  }

  @Override
  public void claim(UserIdDto dto) {
    TaskService taskService = engine.getTaskService();

    taskService.claim(taskId, dto.getUserId());
  }
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.