Examples of Task


Examples of org.jboss.seam.rest.example.client.tasks.Task

    private Task oldestUnresolvedTask;

    @PostConstruct
    public void init() {
        // just in case there are no tasks
        oldestUnresolvedTask = new Task();
        oldestUnresolvedTask.setUpdated(new Date());
        oldestUnresolvedTask.setName("No tasks");
    }
View Full Code Here

Examples of org.jboss.seam.rest.example.tasks.entity.Task

    @Path("/task")
    public Response createTask(JaxbTaskWrapper incommingTask, @PathParam("category") String categoryName,
            @Context UriInfo uriInfo) {
        Category category = loadCategory(categoryName);

        Task task = new Task();
        task.setCategory(category);
        task.setCreated(new Date());
        task.setUpdated(task.getCreated()); // set update date to creation date
        task.setName(incommingTask.getName());
        task.setResolved(false); // not resolved by default
        em.persist(task);
        long id = task.getId();

        URI uri = uriInfo.getBaseUriBuilder().path(TaskCollectionResource.class)
                .path(TaskCollectionResource.class, "getTaskSubresource").build(String.valueOf(id));
        return Response.created(uri).build();
    }
View Full Code Here

Examples of org.jbpm.api.task.Task

    Environment env = ((EnvironmentFactory)processEngine).openEnvironment();

    try
    {
      TaskService taskService = this.processEngine.get(TaskService.class);
      Task t0 = taskService.getTask(Long.toString(taskId));
      return ModelAdaptor.adoptTask(t0);
    }
    finally{
      env.close();
    }
View Full Code Here

Examples of org.jbpm.task.Task

                }
                case GetTaskRequest: {
                    response = CommandName.GetTaskResponse;
                    long taskId = (Long) cmd.getArguments().get(0);

                    Task task = taskSession.getTask(taskId);

                    List args = new ArrayList(1);
                    args.add(task);
                    Command resultsCmnd = new Command(cmd.getId(), CommandName.GetTaskResponse, args);
                    session.write(resultsCmnd);

                    break;
                }
                case AddTaskRequest: {
                    response = CommandName.AddTaskResponse;
                    Task task = (Task) cmd.getArguments().get(0);
                    ContentData content = (ContentData) cmd.getArguments().get(1);
                    taskSession.addTask(task, content);

                    List args = new ArrayList(1);
                    args.add(task.getId());
                    Command resultsCmnd = new Command(cmd.getId(),
                            CommandName.AddTaskResponse,
                            args);
                    session.write(resultsCmnd);
                    break;
                }
                case AddCommentRequest: {
                    response = CommandName.AddCommentResponse;
                    Comment comment = (Comment) cmd.getArguments().get(1);
                    taskSession.addComment((Long) cmd.getArguments().get(0),
                            comment);

                    List args = new ArrayList(1);
                    args.add(comment.getId());
                    Command resultsCmnd = new Command(cmd.getId(),
                            CommandName.AddCommentResponse,
                            args);
                    session.write(resultsCmnd);
                    break;
                }
                case DeleteCommentRequest: {
                    response = CommandName.DeleteCommentResponse;
                    long taskId = (Long) cmd.getArguments().get(0);
                    long commentId = (Long) cmd.getArguments().get(1);
                    taskSession.deleteComment(taskId,
                            commentId);

                    Command resultsCmnd = new Command(cmd.getId(),
                            CommandName.DeleteCommentResponse,
                            Collections.emptyList());
                    session.write(resultsCmnd);
                    break;
                }
                case AddAttachmentRequest: {
                    response = CommandName.AddAttachmentResponse;
                    Attachment attachment = (Attachment) cmd.getArguments().get(1);
                    Content content = (Content) cmd.getArguments().get(2);
                    taskSession.addAttachment((Long) cmd.getArguments().get(0),
                            attachment,
                            content);

                    List args = new ArrayList(2);
                    args.add(attachment.getId());
                    args.add(content.getId());
                    Command resultsCmnd = new Command(cmd.getId(),
                            CommandName.AddAttachmentResponse,
                            args);
                    session.write(resultsCmnd);
                    break;
                }
                case DeleteAttachmentRequest: {
                    response = CommandName.DeleteAttachmentResponse;
                    long taskId = (Long) cmd.getArguments().get(0);
                    long attachmentId = (Long) cmd.getArguments().get(1);
                    long contentId = (Long) cmd.getArguments().get(2);
                    taskSession.deleteAttachment(taskId,
                            attachmentId,
                            contentId);
                    Command resultsCmnd = new Command(cmd.getId(),
                            CommandName.DeleteAttachmentResponse,
                            Collections.emptyList());
                    session.write(resultsCmnd);
                    break;
                }
                case SetDocumentContentRequest: {
                    response = CommandName.SetDocumentContentResponse;
                    long taskId = (Long) cmd.getArguments().get(0);
                    Content content = (Content) cmd.getArguments().get(1);
                    taskSession.setDocumentContent(taskId,
                            content);

                    List args = new ArrayList(1);
                    args.add(content.getId());
                    Command resultsCmnd = new Command(cmd.getId(),
                            CommandName.SetDocumentContentResponse,
                            args);
                    session.write(resultsCmnd);
                    break;
                }
                case GetContentRequest: {
                    response = CommandName.GetContentResponse;
                    long contentId = (Long) cmd.getArguments().get(0);
                    Content content = taskSession.getContent(contentId);
                    List args = new ArrayList(1);
                    args.add(content);
                    Command resultsCmnd = new Command(cmd.getId(),
                            CommandName.GetContentResponse,
                            args);
                    session.write(resultsCmnd);
                    break;
                }
                case QueryTaskByWorkItemId: {
                    response = CommandName.QueryTaskByWorkItemIdResponse;
                    Task result = taskSession.getTaskByWorkItemId((Long) cmd.getArguments().get(0));
                    List args = new ArrayList(1);
                    args.add(result);
                    Command resultsCmnd = new Command(cmd.getId(),
                            CommandName.QueryTaskByWorkItemIdResponse,
                            args);
View Full Code Here

Examples of org.jbpm.taskmgmt.def.Task

   * creates a task instance on the rootToken, and assigns it to the currently authenticated user.
   */
  public TaskInstance createStartTaskInstance()
  {
    TaskInstance taskInstance = null;
    Task startTask = taskMgmtDefinition.getStartTask();
    if (startTask != null)
    {
      Token rootToken = processInstance.getRootToken();
      ExecutionContext executionContext = new ExecutionContext(rootToken);
      taskInstance = createTaskInstance(startTask, executionContext);
View Full Code Here

Examples of org.jclouds.savvis.vpdc.domain.Task

   }

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

      Task result = factory.create(injector.getInstance(TaskHandler.class)).parse(is);
      Task expects = Task
            .builder()
            .id("21-1002")
            .endTime(dateService.iso8601DateParse("2010-05-26T08:09:09.000+08:00"))
            .startTime(dateService.iso8601DateParse("2010-05-26T08:08:08.000+08:00"))
            .status(Task.Status.SUCCESS)
            .type("application/vnd.vmware.vcloud.task+xml")
            .href(URI.create("https://api.savvis.net/rest/api/v0.8/task/21-1002"))
            .owner(
                  ResourceImpl
                        .builder()
                        .id("2736")
                        .name("mockVpdc8")
                        .type("application/vnd.vmware.vcloud.vdc+xml")
                        .href(URI
                              .create("https://api.savvis.net/rest/api/v0.8/org/100000.0/vdc/2736"))
                        .build())
            .result(
                     ResourceImpl
                        .builder()
                        .id("1002")
                        .name("mock_vpdc_item_007")
                        .type("application/vnd.vmware.vcloud.vApp+xml")
                        .href(URI
                              .create("https://api.savvis.net/rest/api/v0.8/org/100000.0/vdc/2736/vApp/1002"))
                        .build()).build();
      assertEquals(result.toString(), expects.toString());

   }
View Full Code Here

Examples of org.jclouds.trmk.vcloud_0_8.domain.Task

   }

   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.ultradns.ws.domain.Task

public class GetStatusForTaskResponseResponseTest extends BaseHandlerTest {

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

      Task expected = expected();

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

      assertEquals(result.toString(), expected.toString());
   }
View Full Code Here

Examples of org.jclouds.vcloud.director.v1_5.domain.Task

  }

   @Test(description = "GET /vms/query", dependsOnMethods = { "testQueryAllVApps" })
   public void testQueryAllVms() {
      // Wait for vApp to have been entirely instantiated
      Task instantiateTask = Iterables.getFirst(vApp.getTasks(), null);
      if (instantiateTask != null) {
         assertTaskSucceedsLong(instantiateTask);
      }

      // Start the vApp so that it has VMs
      Task task = vAppApi.powerOn(vApp.getId());
      assertTaskSucceedsLong(task);

      vApp = vAppApi.get(vApp.getId()); // reload, so it has the VMs
      List<Vm> vms = vApp.getChildren().getVms();
      Set<URI> vmHrefs = toHrefs(vms);
View Full Code Here

Examples of org.jclouds.vcloud.domain.Task

         node = getOnlyElement(client.createNodesInGroup(group, 1));

         Predicate<URI> taskTester = retry(new TaskSuccess(getVCloudApi()), 600, 5, SECONDS);

         // I have to undeploy first
         Task task = getVCloudApi().getVAppClient().undeployVApp(URI.create(node.getId()));

         // wait up to ten minutes per above
         assert taskTester.apply(task.getHref()) : node;

         VApp vApp = getVCloudApi().getVAppClient().getVApp(URI.create(node.getId()));

         // wait up to ten minutes per above
         assertEquals(vApp.getStatus(), Status.OFF);

         // vdc is equiv to the node's location
         // vapp uri is the same as the node's id
         vappTemplate = getVCloudApi().getVAppTemplateClient().captureVAppAsTemplateInVDC(URI.create(node.getId()),
                  group, URI.create(node.getLocation().getId()));

         assertEquals(vappTemplate.getName(), group);

         task = vappTemplate.getTasks().get(0);

         // wait up to ten minutes per above
         assert taskTester.apply(task.getHref()) : vappTemplate;

         item = getVCloudApi().getCatalogClient().addVAppTemplateOrMediaImageToCatalogAndNameItem(
                  vappTemplate.getHref(),
                  getVCloudApi().getCatalogClient().findCatalogInOrgNamed(null, null).getHref(), "fooname",
                  CatalogItemOptions.Builder.description("description").properties(ImmutableMap.of("foo", "bar")));
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.