HumanTaskService extends PFPBaseService implements ITaskService { @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) public long addTask(Task taskObj, ContentData cData) throws CannotAddTaskException { OrganizationalEntity orgOBj = taskObj.getTaskData().getCreatedBy(); checkAndSetTempOrgEntitySet(orgOBj); checkAndSetListOfOrgEntities(taskObj.getPeopleAssignments().getPotentialOwners()); TaskServiceSession taskSession = null; try { taskSession = taskService.createSession(); taskSession.addTask(taskObj, cData); int sessionId = taskObj.getTaskData().getProcessSessionId(); eventSupport.fireTaskAdded(taskObj, cData); return taskObj.getId(); }finally { if(taskSession != null) taskSession.dispose(); } }  @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) long addTask(Task taskObj, ContentData cData); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) void claimTask(Long taskId, String idRef, String userId, List<String> roles); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) TaskSummary guaranteedClaimTaskAssignedAsPotentialOwnerByStatusByGroup(String userId, List<String> groupIds, List<Status> statuses, String language, Integer firstResult, Integer maxResults); void completeTask(Long taskId, Map<String, Object> outboundTaskVars, String userId); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) void delegateTask(Long taskId, String userId, String targetUserId); void failTask(Long taskId, Map<String, Object> outboundTaskVars, String userId, String faultName); @Override void exitTask(Long taskId, String userId); void nominateTask(final long taskId, String userId, final List<OrganizationalEntity> potentialOwners); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) void releaseTask(Long taskId, String userId); void skipTask(Long taskId, String userId, Map<String, Object> outboundTaskVars); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) void skipTaskByWorkItemId(Long workItemId); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) void startTask(Long taskId, String userId); TaskSummary getTask(Long taskId); Task getTaskByWorkItemId(Long workItemId); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) List<TaskSummary> getTasksAssignedAsPotentialOwner(String userId, List<String> groupIds, String language); void dumpTaskDetails(Task taskObj, StringBuilder sBuilder); String getTaskName(Long taskId, String language); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) Map<String,Object> getTaskContent(Long taskId, Boolean inbound); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) void setTaskContent(Task taskObj, Boolean inbound, Map<String, Object> taskContent); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) void setTaskContent(Long taskId, String userId, Boolean inbound, Map<String, Object> taskContent); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) String printTaskContent(Long taskId, Boolean inbound); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) List<TaskSummary> getTasksByProcessInstance(Long processInstanceId, Status taskStatus); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) List<TaskSummary> getTasksAssignedAsPotentialOwner(String userId, List<String> groupIds, String language, Integer firstResult, Integer maxResults); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) List<TaskSummary> getTasksAssignedAsPotentialOwnerByStatusByGroup(String userId, List<String> groupIds, List<Status> statuses, String language, Integer firstResult, Integer maxResults); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) List<TaskSummary> getTasksAssignedAsPotentialOwnerByStatus(String userId, List<Status> statuses, String language, Integer firstResult, Integer maxResults); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) List<TaskSummary> getAssignedTasks(String userId, List<Status> statuses, String language); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) List<?> query(String qlString, Integer size, Integer offset); @PostConstruct void start(); @PreDestroy void stop(); @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) Content getContent(Long contentId); Map populateHashWithTaskContent(Content contentObj, String keyName); boolean isEnableIntelligentMapping(); void setEnableIntelligentMapping(boolean enableIntelligentMapping); static final String JBPM_TASK_EMF_RESOURCE_LOCAL; static final String JBPM_TASK_EMF; static final String TASK_BY_TASK_ID; static final String GROUP; static final String USER; }
@Test public void addTaskTest() { Task taskObj = new Task(); ContentData inboundTaskVars = null; htService.addTask(taskObj, inboundTaskVars); }