Examples of TaskImpl


Examples of org.jbpm.pvm.internal.task.TaskImpl

      task.resume();
    }
  }

  public TaskImpl createTask() {
    TaskImpl task = newTask();
    task.setCreateTime(Clock.getCurrentTime());
    return task;
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.task.TaskImpl

    task.setCreateTime(Clock.getCurrentTime());
    return task;
  }

  protected TaskImpl newTask() {
    TaskImpl task = new TaskImpl();
    task.setNew(true);
    return task;
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.task.TaskImpl

    this.taskId = taskId;
  }

  public Void execute(Environment environment) throws Exception {
    DbSession dbSession = environment.get(DbSession.class);
    TaskImpl task = dbSession.get(TaskImpl.class, Long.parseLong(taskId));
    task.setVariables(variables);
  
    return null;
  }
View Full Code Here

Examples of org.jbpm.pvm.internal.task.TaskImpl

  public Object execute(Environment environment) throws Exception {
    Session session = Environment.getFromCurrent(Session.class);
   
    if (taskId!=null) {
      TaskImpl task = (TaskImpl) session.get(TaskImpl.class, Long.parseLong(taskId));
      if (task==null) {
        throw new JbpmException("task "+taskId+" was not found");
      }

      task.addParticipation(userId, groupId, type);
    }

    /*
    if (swimlaneDbid!=null) {
      SwimlaneImpl swimlane = (TaskImpl) session.get(SwimlaneImpl.class, swimlaneDbid);
View Full Code Here

Examples of org.jbpm.services.task.impl.model.TaskImpl

        // TaskService
        InternalTaskService injectedTaskServiceMock = mock(InternalTaskService.class);

        // - set task instance
        InternalTask task = new TaskImpl();
        task.setId(TASK_ID);
        task.setTaskData(new TaskDataImpl());

        doThrow(new IllegalStateException("Use the getTaskById() method, which should already have been called!"))
            .when(injectedTaskServiceMock).execute(any(GetTaskCommand.class));
        doReturn(task).when(injectedTaskServiceMock).getTaskById(TASK_ID);

        // task is independent
        if (independentTask) {
            // no deployment id == independent task
            ((InternalTaskData) task.getTaskData()).setDeploymentId(null);
           
            // runtime task engine should not be used
            doThrow(new IllegalStateException("The runtime engine TaskService should not be used here!")).when(runtimeEngineMock).getTaskService();

            // - injected task service should execute commands
            doReturn(null).when(injectedTaskServiceMock).execute(any(ClaimTaskCommand.class));
            doReturn(null).when(injectedTaskServiceMock).execute(any(StartTaskCommand.class));
            doReturn(null).when(injectedTaskServiceMock).execute(any(CompleteTaskCommand.class));
            doReturn(null).when(injectedTaskServiceMock).execute(any(ReleaseTaskCommand.class));
            doReturn(null).when(injectedTaskServiceMock).execute(any(ExitTaskCommand.class));
            doReturn(null).when(injectedTaskServiceMock).execute(any(SkipTaskCommand.class));
        } else {
            // deployment id available == process task
            ((InternalTaskData) task.getTaskData()).setDeploymentId(DEPLOYMENT_ID);
           
            // - injected task service should only be used to retrieve task
            doReturn(runtimeTaskServiceMock).when(runtimeEngineMock).getTaskService();
           
            // - runtime engine should execute commands affecting kiesssions
View Full Code Here

Examples of org.jclouds.trmk.vcloud_0_8.domain.internal.TaskImpl

   public void testTerremark() {
      InputStream is = getClass().getResourceAsStream("/task.xml");

      Task result = factory.create(injector.getInstance(TaskHandler.class)).parse(is);
      Task expects = new TaskImpl(URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/task/3299"), null,
            TaskStatus.SUCCESS, dateService.iso8601DateParse("2009-08-24T21:29:32.983Z"),
            dateService.iso8601DateParse("2009-08-24T21:29:44.65Z"), null, new ReferenceTypeImpl("Server1",
                  TerremarkVCloudMediaType.VAPP_XML,
                  URI.create("https://services.vcloudexpress.terremark.com/api/v0.8/vapp/4012")), null
View Full Code Here

Examples of org.jclouds.trmk.vcloud_0_8.domain.internal.TaskImpl

   public void testSelf() {
      InputStream is = getClass().getResourceAsStream("/task-self.xml");

      Task result = factory.create(injector.getInstance(TaskHandler.class)).parse(is);

      Task expects = new TaskImpl(URI.create("https://vcloud.safesecureweb.com/api/v0.8/task/d188849-78"), null,
            TaskStatus.QUEUED, null, null, null, null, null);
      assertEquals(result, expects);

   }
View Full Code Here

Examples of org.jclouds.trmk.vcloud_0_8.domain.internal.TaskImpl

   public void testError() {
      InputStream is = getClass().getResourceAsStream("/task-error.xml");

      Task result = factory.create(injector.getInstance(TaskHandler.class)).parse(is);

      Task expects = new TaskImpl(URI.create("http://10.150.4.49/api/v0.8/task/23"), null, TaskStatus.ERROR,
            dateService.iso8601SecondsDateParse("2009-12-07T19:05:02Z"),
            dateService.iso8601SecondsDateParse("2009-12-10T14:40:32Z"), null, new ReferenceTypeImpl("testapp1",
                  TerremarkVCloudMediaType.VAPP_XML, URI.create("http://10.150.4.49/api/v0.8/vapp/1")), new ErrorImpl(
                  "Error processing job", 500, MinorCode.UNRECOGNIZED,
                  " Error in runDailySummaries date used:2009-12-09 19:40:30.577326+00:00", null));
View Full Code Here

Examples of org.jclouds.trmk.vcloud_0_8.domain.internal.TaskImpl

   }

   @Override
   public void endElement(String uri, String localName, String qName) {
      if (qName.equalsIgnoreCase("Task")) {
         this.task = new TaskImpl(taskLink.getHref(), operation, status, startTime, endTime, expiryTime, owner, error);
         operation = null;
         taskLink = null;
         status = null;
         startTime = null;
         endTime = null;
View Full Code Here

Examples of org.jclouds.trmk.vcloud_0_8.domain.internal.TaskImpl

   public Task apply(HttpResponse from) {
      String location = from.getFirstHeaderOrNull(HttpHeaders.LOCATION);
      if (location == null)
         location = from.getFirstHeaderOrNull("location");
      if (location != null) {
         return new TaskImpl(URI.create(location), null, TaskStatus.QUEUED, new Date(), null, null, null, null);
      } else {
         throw new HttpResponseException("no uri in headers or content", null, from);
      }

   }
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.