Package org.intalio.tempo.workflow.task

Examples of org.intalio.tempo.workflow.task.Task


        Task[] tasks = tmsServer.getTaskList(dao,TOKEN_CURRENT);

        /*
         * Select one task to re-assign
         */
        Task selectTask = tasks[0];
        String selectTaskId = selectTask.getID();
        _logger.debug("Select one task: " + selectTaskId);

        /*
         * Select a user to be re-assigned.
         */
        AuthIdentifierSet targetUserSet = new AuthIdentifierSet();
        String targetUserId = users[0];
        _logger.debug("Select one target user = " + targetUserId);
        targetUserSet.add(targetUserId);

        /*
         * Re-assign task
         */
        tmsServer.reassign(dao,selectTask.getID(), targetUserSet, new AuthIdentifierSet(), TaskState.READY, "token1");
        _logger.debug("Reassign task[" + selectTaskId + "] to " + targetUserId);

        /*
         * check that the task is not in the inbox of current user
         */
 
View Full Code Here


  @Test
  public void userTaskListShouldBeEmptyWhenATaskWithNoUserIsAdded()
      throws Exception {
    // get a sample task and commit it. check it's not assigned already.
    Task t = getRandomSampleTask();
    connection.createTask(t);
    connection.commit();
    updateTasksAndCheckCount(USER, 0,
        "Got some tasks after creating a task with no assigned user.");
  }
View Full Code Here

        "Got some tasks after creating a task with no assigned user.");
  }

  @Test
  public void userShouldGetATaskWhenUserOrRolesMatch() throws Exception {
    Task t = getRandomSampleTask();
    // add some user and roles to the task, update the persisted task and
    // check it's in the list
    t.getUserOwners().add(USER);
    t.getRoleOwners().add(ROLE);
    connection.createTask(t);
    connection.commit();
    updateTasksAndCheckCount(USER, 1,
        "Expecting one task for the current user");
  }
View Full Code Here

  @Test
  public void userShouldGetAllTheFiftyTasksAssignedToHim() throws Exception {
    // add quite a few random tasks
    for (int i = 0; i < TASK_COUNT; i++) {
      Task t2 = getRandomSampleTask();
      t2.getUserOwners().add(USER);
      t2.getRoleOwners().add(ROLE);
      connection.createTask(t2);
      connection.commit();
      Task t3 = connection.fetchTaskIfExists(t2.getID());
      TaskEquality.areTasksEquals(t2, t3);
    }
    updateTasksAndCheckCount(USER, TASK_COUNT + 1,
        "User does not have a proper task count in his inbox.");
  }
View Full Code Here

        }
        _tasks.put(id, task);
    }

    public synchronized boolean deleteTask(int internalTaskId, String taskID) {
        Task removedTask = _tasks.remove(taskID);
        return removedTask != null;
    }
View Full Code Here

        tms.create(task1);

        task1.setDescription(description);
        tms.update(task1);

        Task updated = tms.getTask(id);
        Assert.assertEquals(description, updated.getDescription());

        task1.setDescription("new one");
        tms.update(task1);
        Task updated2 = tms.getTask(id);
        Assert.assertNotSame(description, updated2.getDescription());

        tms.delete(new String[] { id });
    }
View Full Code Here

        OMElement rootElement = TestUtils.loadElementFromResource(file);

        Iterator<OMElement> i = rootElement.getChildElements();
        while (i.hasNext()) {
            OMElement metadataElement = i.next();
            Task task = unmarshaller.unmarshalTaskFromMetadata(metadataElement);
            OMElement remarshalledMetadata = marshaller.marshalTaskMetadata(task, null);
            _logger.debug(TestUtils.toPrettyXML(remarshalledMetadata));
        }
    }
View Full Code Here

    }

    public void testCustomerTask1() throws Exception {
        OMElement rootElement = TestUtils.loadElementFromResource("/customerTask1.xml");
        TaskUnmarshaller unmarshaller = new TaskUnmarshaller();
        Task task = unmarshaller.unmarshalTaskFromMetadata(rootElement);
    }
View Full Code Here

        TaskUnmarshaller unmarshaller = new TaskUnmarshaller();
        OMFactory factory = OMAbstractFactory.getOMFactory();
        TaskMarshaller marshaller = new TaskMarshaller();
        OMElement rootElement = TestUtils.loadElementFromResource(resourceName);

        Task task = unmarshaller.unmarshalFullTask(rootElement);
        OMElement remarshalledTask = factory.createOMElement("task", TaskXMLConstants.TASK_NAMESPACE, TaskXMLConstants.TASK_NAMESPACE_PREFIX);

        marshaller.marshalFullTask(task, remarshalledTask, null);
        _logger.debug(TestUtils.toPrettyXML(remarshalledTask));
    }
View Full Code Here

            Assert.fail("RequiredArgumentException expected");
        } catch (RequiredArgumentException e) {

        }
        try {
            Task task = new Task("id", new URI("http://localhost/")) {};
            TaskTypeMapper.getTypeClassName(task.getClass());
            Assert.fail("IllegalArgumentException expected");
        } catch (IllegalArgumentException e) {

        }
    }
View Full Code Here

TOP

Related Classes of org.intalio.tempo.workflow.task.Task

Copyright © 2018 www.massapicom. 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.