Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.jbpm.core.service
Class JbpmTaskServiceImpl

java.lang.Object
  extended by org.nuxeo.ecm.platform.jbpm.core.service.JbpmTaskServiceImpl
All Implemented Interfaces:
Serializable, JbpmTaskService

public class JbpmTaskServiceImpl
extends Object
implements JbpmTaskService

Implementation of the JbpmTaskService

Author:
Anahide Tchertchian
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.nuxeo.ecm.platform.jbpm.JbpmTaskService
JbpmTaskService.TaskVariableName
 
Field Summary
 
Fields inherited from interface org.nuxeo.ecm.platform.jbpm.JbpmTaskService
TASK_INSTANCE_EVENT_PROPERTIES_KEY
 
Constructor Summary
JbpmTaskServiceImpl()
           
 
Method Summary
 void acceptTask(CoreSession coreSession, NuxeoPrincipal principal, TaskInstance task, String comment)
          Ends the task using event name JbpmEventNames.WORKFLOW_TASK_COMPLETED and marking the task as validated.
 boolean canEndTask(NuxeoPrincipal principal, TaskInstance task)
          Returns true if user is an administrator, the initiator of the task, or an actor of the task.
 void createTask(CoreSession coreSession, NuxeoPrincipal principal, DocumentModel document, String taskName, List<String> prefixedActorIds, boolean createOneTaskPerActor, String directive, String comment, Date dueDate, Map<String,Serializable> taskVariables)
          Creates a task and starts it.
 void endTask(CoreSession coreSession, NuxeoPrincipal principal, TaskInstance task, String comment, String eventName, boolean isValidated)
          Ends the task
 void rejectTask(CoreSession coreSession, NuxeoPrincipal principal, TaskInstance task, String comment)
          Ends the task using event name JbpmEventNames.WORKFLOW_TASK_REJECTED and marking the task as not validated.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JbpmTaskServiceImpl

public JbpmTaskServiceImpl()
Method Detail

createTask

public void createTask(CoreSession coreSession,
                       NuxeoPrincipal principal,
                       DocumentModel document,
                       String taskName,
                       List<String> prefixedActorIds,
                       boolean createOneTaskPerActor,
                       String directive,
                       String comment,
                       Date dueDate,
                       Map<String,Serializable> taskVariables)
                throws NuxeoJbpmException
Description copied from interface: JbpmTaskService
Creates a task and starts it. Notifies events with names JbpmEventNames.WORKFLOW_TASK_ASSIGNED and JbpmEventNames.WORKFLOW_TASK_ASSIGNED, passing the task in the event properties using key JbpmTaskService.TASK_INSTANCE_EVENT_PROPERTIES_KEY

Specified by:
createTask in interface JbpmTaskService
Parameters:
coreSession - the session to use when notifying
principal - the principal marked as initiator of the task and used when notifying.
document - the document to attach to the task.
taskName - the task name.
prefixedActorIds - the list of actor ids, prefixed with 'user:' or 'group:'.
createOneTaskPerActor - if true, one task will be created per actor, else a single task will be assigned to all actors.
directive - the directive, put in the task variables.
comment - string added to the task comments and used as a notification comment
dueDate - the due date, set on the task instance
taskVariables - additional task variables
Throws:
NuxeoJbpmException

acceptTask

public void acceptTask(CoreSession coreSession,
                       NuxeoPrincipal principal,
                       TaskInstance task,
                       String comment)
                throws NuxeoJbpmException
Description copied from interface: JbpmTaskService
Ends the task using event name JbpmEventNames.WORKFLOW_TASK_COMPLETED and marking the task as validated.

Specified by:
acceptTask in interface JbpmTaskService
Throws:
NuxeoJbpmException
See Also:
JbpmTaskService.endTask(CoreSession, NuxeoPrincipal, TaskInstance, String, String, boolean)

rejectTask

public void rejectTask(CoreSession coreSession,
                       NuxeoPrincipal principal,
                       TaskInstance task,
                       String comment)
                throws NuxeoJbpmException
Description copied from interface: JbpmTaskService
Ends the task using event name JbpmEventNames.WORKFLOW_TASK_REJECTED and marking the task as not validated.

Specified by:
rejectTask in interface JbpmTaskService
Throws:
NuxeoJbpmException
See Also:
JbpmTaskService.endTask(CoreSession, NuxeoPrincipal, TaskInstance, String, String, boolean)

endTask

public void endTask(CoreSession coreSession,
                    NuxeoPrincipal principal,
                    TaskInstance task,
                    String comment,
                    String eventName,
                    boolean isValidated)
             throws NuxeoJbpmException
Description copied from interface: JbpmTaskService
Ends the task

Specified by:
endTask in interface JbpmTaskService
Parameters:
coreSession - the session to use when notifying and resolving of referenced document for notification.
principal - principal used when notifying
task - the instance to end
comment - string added to the task comments and used as a notification comment
eventName - the event name to use when notifying
isValidated - boolean marker to state if the task was validated or rejected
Throws:
NuxeoJbpmException - when trying to end a task without being granted the right to do so (see JbpmTaskService.canEndTask(NuxeoPrincipal, TaskInstance)), or when any other error occurs

canEndTask

public boolean canEndTask(NuxeoPrincipal principal,
                          TaskInstance task)
                   throws NuxeoJbpmException
Description copied from interface: JbpmTaskService
Returns true if user is an administrator, the initiator of the task, or an actor of the task.

Specified by:
canEndTask in interface JbpmTaskService
Throws:
NuxeoJbpmException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.