Examples of TaskService


Examples of org.jbpm.task.service.TaskService

    if (isRunning())
      throw new IllegalStateException("Server is already started");
    this.running = true;
    EntityManagerFactory entityManagerFactory = Persistence
        .createEntityManagerFactory("org.drools.task");
    TaskService taskService = new TaskService(entityManagerFactory,
        SystemEventListenerFactory.getSystemEventListener());
    TaskServiceSession taskSession = taskService.createSession();
    MockUserInfo userInfo = new MockUserInfo();
    taskService.setUserinfo(userInfo);

    for (String userName : getDefaultUsers()) {
      taskSession.addUser(new User(userName));
    }
View Full Code Here

Examples of org.kie.api.task.TaskService

        super.setUp();
       
        RuntimeManager runtimeManager = createRuntimeManager(Strategy.SINGLETON, "test", "BPMN2-HumanTaskWithTaskContent.bpmn2");
        RuntimeEngine runtimeEngine = runtimeManager.getRuntimeEngine(null);
        KieSession ksession = runtimeEngine.getKieSession();
        TaskService taskService = runtimeEngine.getTaskService();
       
        ProcessInstance procInst = ksession.startProcess("org.kie.remote.test.usertask.UserTask");
        long procInstId = procInst.getId();

        List<Long> statuses = new ArrayList<Long>();
View Full Code Here

Examples of org.kie.api.task.TaskService

        RuntimeManager manager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(environment);
        RuntimeEngine engine = manager.getRuntimeEngine(EmptyContext.get());

        KieSession ksession = engine.getKieSession();
        TaskService taskService = engine.getTaskService();

        Map<String,Object> params = new HashMap<String,Object>();
        params.put("userid", "max");
        ProcessInstance processInstance = ksession.startProcess("agu.samples.sample1", params);

        AuditLogService logService = (AuditLogService) context.getBean("logService");
        DefaultTransactionDefinition def = new DefaultTransactionDefinition();
        TransactionStatus status = aptm.getTransaction(def);
        ProcessInstanceLog log = logService.findProcessInstance(processInstance.getId());
        assertNotNull(log);
        aptm.commit(status);

        List<TaskSummary> tasks = taskService.getTasksOwned("max", "en-UK");
        System.out.println("Found " + tasks.size() + " task(s) for user 'max'");

        long taskId = tasks.get(0).getId();
        taskService.start(taskId, "max");
        taskService.complete(taskId, "max", null);


        tasks = taskService.getTasksAssignedAsPotentialOwner("max", "en-UK");
        System.out.println("Found " + tasks.size() + " task(s) for user 'max'");

        taskId = tasks.get(0).getId();
        taskService.start(taskId, "max");
        taskService.complete(taskId, "max", null);


        processInstance = ksession.getProcessInstance(processInstance.getId());
        assertNull(processInstance);
        System.out.println("Process instance completed");
View Full Code Here

Examples of org.kie.api.task.TaskService

        RuntimeManager manager = (RuntimeManager) context.getBean("runtimeManager");

        RuntimeEngine engine = manager.getRuntimeEngine(null);
        KieSession ksession = engine.getKieSession();
        TaskService taskService = engine.getTaskService();

        ProcessInstance processInstance = ksession.startProcess("com.sample.bpmn.hello");

        System.out.println("Process started");

        AuditLogService logService = (AuditLogService) context.getBean("logService");
        ProcessInstanceLog log = logService.findProcessInstance(processInstance.getId());
        assertNotNull(log);

        List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("john", "en-UK");
        System.out.println("Found " + tasks.size() + " task(s) for user 'john'");
        assertEquals(1, tasks.size());

        long taskId = tasks.get(0).getId();
        taskService.start(taskId, "john");
        taskService.complete(taskId, "john", null);

        tasks = taskService.getTasksAssignedAsPotentialOwner("mary", "en-UK");
        System.out.println("Found " + tasks.size() + " task(s) for user 'mary'");
        assertEquals(1, tasks.size());

        taskId = tasks.get(0).getId();
        taskService.start(taskId, "mary");
        taskService.complete(taskId, "mary", null);

        processInstance = ksession.getProcessInstance(processInstance.getId());
        assertNull(processInstance);
        System.out.println("Process instance completed");
    }
View Full Code Here

Examples of org.restlet.service.TaskService

    // with proper changes (component changed to application):
    if ((getApplication() != null) && (getApplication().isStarted())) {
      try {
        try {
          // here, we _ensure_ it is shut down properly, since the allowed shutdown seems never invoked?
          final TaskService taskService = getApplication().getTaskService();

          if (taskService != null) {
            taskService.setShutdownAllowed(true);
            taskService.shutdownNow();
          }
        }
        finally {
          getApplication().stop();
        }
View Full Code Here

Examples of org.wicketstuff.progressbar.spring.TaskService

  /**
   *
   */
  public ExampleApplication() {
    taskService = new TaskService(new AsynchronousExecutor());
  }
View Full Code Here

Examples of org.wso2.carbon.ntask.core.service.TaskService

    // acquire serialized data from registry
    acquireData();

    // gets the task service
    TaskService taskService = DeclarativeServiceReferenceHolder
        .getInstance().getTaskService();

    if (dataHolder.getEnableBAMDataPublisher()) {

      // register and schedule, BAM data publisher task
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.