org.alfresco.repo.workflow.jbpm
Class JBPMEngine

java.lang.Object
  extended by org.alfresco.repo.workflow.BPMEngine
      extended by org.alfresco.repo.workflow.AlfrescoBpmEngine
          extended by org.alfresco.repo.workflow.jbpm.JBPMEngine
All Implemented Interfaces:
TaskComponent, WorkflowComponent, WorkflowEngine, org.springframework.beans.factory.InitializingBean

public class JBPMEngine
extends AlfrescoBpmEngine
implements WorkflowEngine

JBoss JBPM based implementation of: Workflow Definition Component Workflow Component Task Component


Field Summary
protected  AuthorityDAO authorityDAO
           
protected  java.lang.String companyHomePath
           
protected  org.alfresco.service.cmr.repository.StoreRef companyHomeStore
           
static java.lang.String ENGINE_ID
           
protected static java.lang.String ERR_END_TASK_INVALID_TRANSITION
           
protected static java.lang.String ERR_FIND_COMPLETED_TASK_INSTS
           
protected static java.lang.String ERR_INVALID_EVENT
           
protected  org.springmodules.workflow.jbpm31.JbpmTemplate jbpmTemplate
           
protected  org.alfresco.service.cmr.repository.NodeService nodeService
           
protected  PersonService personService
           
protected  ServiceRegistry serviceRegistry
           
protected  org.alfresco.service.cmr.search.SearchService unprotectedSearchService
           
 
Fields inherited from class org.alfresco.repo.workflow.AlfrescoBpmEngine
authorityManager, dictionaryService, factory, messageService, namespaceService, tenantService
 
Constructor Summary
JBPMEngine()
           
 
Method Summary
 WorkflowInstance cancelWorkflow(java.lang.String workflowId)
          Cancel an "in-flight" Workflow instance
protected  org.alfresco.repo.workflow.jbpm.JBPMEngine.CompiledProcessDefinition compileProcessDefinition(java.io.InputStream definitionStream, java.lang.String mimetype)
          Construct a Process Definition from the provided Process Definition stream
protected  WorkflowDefinition createWorkflowDefinition(org.jbpm.graph.def.ProcessDefinition definition)
          Creates a Workflow Definition
protected  WorkflowDeployment createWorkflowDeployment(org.alfresco.repo.workflow.jbpm.JBPMEngine.CompiledProcessDefinition compiledDef)
          Creates a Workflow Deployment
protected  WorkflowInstance createWorkflowInstance(org.jbpm.graph.exe.ProcessInstance instance)
           
protected  WorkflowInstance createWorkflowInstance(org.jbpm.graph.exe.ProcessInstance instance, WorkflowDefinition definition, java.util.Date endDate, java.util.Map variables)
          Creates a Workflow Instance
protected  WorkflowNode createWorkflowNode(org.jbpm.graph.def.Node node)
          Creates a Workflow Node
protected  WorkflowPath createWorkflowPath(org.jbpm.graph.exe.Token token)
          Creates a Workflow Path
protected  WorkflowPath createWorkflowPath(org.jbpm.graph.exe.Token token, WorkflowInstance wfInstance, WorkflowNode node)
          Creates a Workflow Path
protected  WorkflowTask createWorkflowTask(org.jbpm.taskmgmt.exe.TaskInstance task)
          * Creates a Workflow Task
protected  WorkflowTaskDefinition createWorkflowTaskDefinition(org.jbpm.taskmgmt.def.Task task)
          Creates a Workflow Task Definition
protected  WorkflowTimer createWorkflowTimer(org.jbpm.job.Timer timer)
          Creates a Workflow Timer
protected  WorkflowTransition createWorkflowTransition(org.jbpm.graph.def.Transition transition)
          Create a Workflow Transition
 WorkflowInstance deleteWorkflow(java.lang.String workflowId)
          Delete an "in-flight" Workflow instance
 WorkflowDeployment deployDefinition(java.io.InputStream workflowDefinition, java.lang.String mimetype)
          Deploy a Workflow Definition
 WorkflowDeployment deployDefinition(java.io.InputStream workflowDefinition, java.lang.String mimetype, java.lang.String name)
          Deploy a Workflow Definition
 WorkflowTask endTask(java.lang.String taskId, java.lang.String transition)
          End the Task (i.e.
 WorkflowPath fireEvent(java.lang.String pathId, java.lang.String event)
          Fire custom event against specified path
 java.util.List getActiveWorkflows()
          Gets all "in-flight" active workflow instances.
 java.util.List getActiveWorkflows(java.lang.String workflowDefinitionId)
          Gets all "in-flight" active workflow instances of the specified Workflow Definition
 java.util.List getAllDefinitions()
          Gets all deployed Workflow Definitions (with all previous versions)
 java.util.List getAllDefinitionsByName(java.lang.String workflowName)
          Gets all (including previous) Workflow Definitions for the given unique name
 java.util.List getAssignedTasks(java.lang.String authority, WorkflowTaskState state)
          Gets all tasks assigned to the specified authority
 java.util.List getCompletedWorkflows()
          Gets all completed workflow instances.
 java.util.List getCompletedWorkflows(java.lang.String workflowDefinitionId)
          Gets all "in-flight" completed workflow instances of the specified Workflow Definition
protected  org.alfresco.service.namespace.QName getDefaultStartTaskType()
           
 WorkflowDefinition getDefinitionById(java.lang.String workflowDefinitionId)
          Gets a Workflow Definition by unique Id
 WorkflowDefinition getDefinitionByName(java.lang.String workflowName)
          Gets a Workflow Definition by unique name
 byte[] getDefinitionImage(java.lang.String workflowDefinitionId)
          Gets a graphical view of the Workflow Definition
 java.util.List getDefinitions()
          Gets all deployed Workflow Definitions
protected  long getJbpmId(java.lang.String id)
          Get JBoss JBPM Id from Engine Global Id
protected  org.alfresco.service.namespace.QName[] getMissingMandatoryTaskProperties(org.jbpm.taskmgmt.exe.TaskInstance instance)
          Get missing mandatory properties on Task
 java.util.Map getPathProperties(java.lang.String pathId)
          Gets the properties associated with the specified path (and parent paths)
 java.util.List getPooledTasks(java.util.List authorities)
          Gets the pooled tasks available to the specified authority
protected  org.jbpm.graph.def.ProcessDefinition getProcessDefinition(org.jbpm.db.GraphSession graphSession, java.lang.String workflowDefinitionId)
          Gets a jBPM process definition
protected  org.jbpm.graph.exe.ProcessInstance getProcessInstance(org.jbpm.db.GraphSession graphSession, java.lang.String workflowId)
          Gets a jBPM Process Instance
 WorkflowTask getStartTask(java.lang.String workflowInstanceId)
          Gets all active timers for the specified workflow
 WorkflowTask getTaskById(java.lang.String taskId)
          Gets a Task by unique Id
 java.util.List getTaskDefinitions(java.lang.String workflowDefinitionId)
          Gets the Task Definitions for the given Workflow Definition
protected  org.jbpm.taskmgmt.exe.TaskInstance getTaskInstance(org.jbpm.db.TaskMgmtSession taskSession, java.lang.String taskId)
          Gets a jBPM Task Instance
protected  java.util.Map getTaskProperties(org.jbpm.taskmgmt.exe.TaskInstance instance, boolean localProperties)
          Gets Properties of Task
protected  java.util.Map getTaskProperties(org.jbpm.taskmgmt.exe.TaskInstance instance, boolean localProperties, java.util.Map variablesCache)
          Gets Properties of Task
 java.util.List getTasksForWorkflowPath(java.lang.String pathId)
          Gets all Tasks associated with the specified path
 java.util.List getTimers(java.lang.String workflowId)
          Gets all active timers for the specified workflow
 WorkflowInstance getWorkflowById(java.lang.String workflowId)
          Gets a specific workflow instances
 java.io.InputStream getWorkflowImage(java.lang.String workflowInstanceId)
          Gets a graphical view of the workflow instance
 java.util.List getWorkflowPaths(java.lang.String workflowId)
          Gets all Paths for the specified Workflow instance
 java.util.List getWorkflows()
          Gets all workflow instances (both active and completed).
 java.util.List getWorkflows(java.lang.String workflowDefinitionId)
          Gets all "in-flight" workflow instances (both active and completed) of the specified Workflow Definition
protected  java.util.List getWorkflowTasks(java.util.List tasks)
           
protected  java.util.List getWorkflowTasks(org.hibernate.Session session, java.util.List rows)
           
protected  WorkflowTaskState getWorkflowTaskState(org.jbpm.taskmgmt.exe.TaskInstance task)
          Get the Workflow Task State for the specified JBoss JBPM Task
protected  org.jbpm.graph.exe.Token getWorkflowToken(org.jbpm.db.GraphSession session, java.lang.String pathId)
          Get the JBoss JBPM Token for the Workflow Path
 boolean hasWorkflowImage(java.lang.String workflowInstanceId)
          Determines if a graphical view of the workflow instance exists
 boolean isDefinitionDeployed(java.io.InputStream workflowDefinition, java.lang.String mimetype)
          Is the specified Workflow Definition already deployed? Note: the notion of "already deployed" may differ between bpm engines.
 java.util.List queryTasks(WorkflowTaskQuery query)
          Query for tasks
 void setAuthorityDAO(AuthorityDAO authorityDAO)
          Sets the Authority DAO
 void setCompanyHomePath(java.lang.String companyHomePath)
          Sets the Company Home Path
 void setCompanyHomeStore(java.lang.String companyHomeStore)
          Sets the Company Home Store
 void setDefaultStartTaskDescription(org.jbpm.taskmgmt.exe.TaskInstance instance)
          Sets default description for the Task
protected  void setDefaultTaskProperties(org.jbpm.taskmgmt.exe.TaskInstance instance)
          Sets Default Properties of Task
protected  void setDefaultWorkflowProperties(org.jbpm.taskmgmt.exe.TaskInstance startTask)
          Initialise Workflow Instance properties
 void setJBPMTemplate(org.springmodules.workflow.jbpm31.JbpmTemplate jbpmTemplate)
          Sets the JBPM Template used for accessing JBoss JBPM in the correct context
 void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
          Sets the Node Service
 void setPersonService(PersonService personService)
          Sets the Person Service
 void setServiceRegistry(ServiceRegistry serviceRegistry)
          Sets the Service Registry
protected  void setTaskProperties(org.jbpm.taskmgmt.exe.TaskInstance instance, java.util.Map properties)
          Sets Properties of Task
 void setUnprotectedSearchService(org.alfresco.service.cmr.search.SearchService unprotectedSearchService)
          Set the unprotected search service - so we can find the node ref for company home when folk do not have read access to company home TODO: review use with DC
 WorkflowPath signal(java.lang.String pathId, java.lang.String transition)
          Signal the transition from one Workflow Node to another within an "in-flight" process.
 WorkflowTask startTask(java.lang.String taskId)
          Start the specified Task Note: this is an optional task operation.
 WorkflowPath startWorkflow(java.lang.String workflowDefinitionId, java.util.Map parameters)
          Start a Workflow Instance
 WorkflowTask suspendTask(java.lang.String taskId)
          Suspend the specified Task
 void undeployDefinition(java.lang.String workflowDefinitionId)
          Undeploy an exisiting Workflow Definition TODO: Determine behaviour when "in-flight" workflow instances exist
 WorkflowTask updateTask(java.lang.String taskId, java.util.Map properties, java.util.Map add, java.util.Map remove)
          Update the Properties and Associations of a Task
 
Methods inherited from class org.alfresco.repo.workflow.AlfrescoBpmEngine
afterPropertiesSet, setDictionaryService, setMessageService, setNamespaceService, setTenantService, setWorkflowAuthorityManager, setWorkflowObjectFactory
 
Methods inherited from class org.alfresco.repo.workflow.BPMEngine
createGlobalId, createLocalId, getEngineId, setBPMEngineRegistry, setEngineId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodeService

protected org.alfresco.service.cmr.repository.NodeService nodeService

serviceRegistry

protected ServiceRegistry serviceRegistry

personService

protected PersonService personService

authorityDAO

protected AuthorityDAO authorityDAO

jbpmTemplate

protected org.springmodules.workflow.jbpm31.JbpmTemplate jbpmTemplate

unprotectedSearchService

protected org.alfresco.service.cmr.search.SearchService unprotectedSearchService

companyHomeStore

protected org.alfresco.service.cmr.repository.StoreRef companyHomeStore

companyHomePath

protected java.lang.String companyHomePath

ERR_INVALID_EVENT

protected static final java.lang.String ERR_INVALID_EVENT
See Also:
Constant Field Values

ERR_FIND_COMPLETED_TASK_INSTS

protected static final java.lang.String ERR_FIND_COMPLETED_TASK_INSTS
See Also:
Constant Field Values

ERR_END_TASK_INVALID_TRANSITION

protected static final java.lang.String ERR_END_TASK_INVALID_TRANSITION
See Also:
Constant Field Values

ENGINE_ID

public static final java.lang.String ENGINE_ID
See Also:
Constant Field Values
Constructor Detail

JBPMEngine

public JBPMEngine()
Method Detail

setJBPMTemplate

public void setJBPMTemplate(org.springmodules.workflow.jbpm31.JbpmTemplate jbpmTemplate)
Sets the JBPM Template used for accessing JBoss JBPM in the correct context

Parameters:
jbpmTemplate -

setNodeService

public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Sets the Node Service

Parameters:
nodeService -

setPersonService

public void setPersonService(PersonService personService)
Sets the Person Service

Parameters:
personService -

setAuthorityDAO

public void setAuthorityDAO(AuthorityDAO authorityDAO)
Sets the Authority DAO

Parameters:
authorityDAO -

setServiceRegistry

public void setServiceRegistry(ServiceRegistry serviceRegistry)
Sets the Service Registry

Parameters:
serviceRegistry -

setCompanyHomePath

public void setCompanyHomePath(java.lang.String companyHomePath)
Sets the Company Home Path

Parameters:
companyHomePath -

setCompanyHomeStore

public void setCompanyHomeStore(java.lang.String companyHomeStore)
Sets the Company Home Store

Parameters:
companyHomeStore -

setUnprotectedSearchService

public void setUnprotectedSearchService(org.alfresco.service.cmr.search.SearchService unprotectedSearchService)
Set the unprotected search service - so we can find the node ref for company home when folk do not have read access to company home TODO: review use with DC

Parameters:
unprotectedSearchService -

deployDefinition

public WorkflowDeployment deployDefinition(java.io.InputStream workflowDefinition,
                                           java.lang.String mimetype)
Description copied from interface: WorkflowComponent
Deploy a Workflow Definition

Specified by:
deployDefinition in interface WorkflowComponent
Parameters:
workflowDefinition - the content object containing the definition
mimetype - (optional) the mime type of the workflow definition
Returns:
workflow deployment descriptor

deployDefinition

public WorkflowDeployment deployDefinition(java.io.InputStream workflowDefinition,
                                           java.lang.String mimetype,
                                           java.lang.String name)
Description copied from interface: WorkflowComponent
Deploy a Workflow Definition

Specified by:
deployDefinition in interface WorkflowComponent
Parameters:
workflowDefinition - the content object containing the definition
mimetype - (optional) the mime type of the workflow definition
name - (optional) a name to represent the deployment
Returns:
workflow deployment descriptor

isDefinitionDeployed

public boolean isDefinitionDeployed(java.io.InputStream workflowDefinition,
                                    java.lang.String mimetype)
Description copied from interface: WorkflowComponent
Is the specified Workflow Definition already deployed? Note: the notion of "already deployed" may differ between bpm engines. For example, different versions of the same process may be considered equal.

Specified by:
isDefinitionDeployed in interface WorkflowComponent
Parameters:
workflowDefinition - the definition to check
mimetype - the mimetype of the definition
Returns:
true => already deployed

undeployDefinition

public void undeployDefinition(java.lang.String workflowDefinitionId)
Description copied from interface: WorkflowComponent
Undeploy an exisiting Workflow Definition TODO: Determine behaviour when "in-flight" workflow instances exist

Specified by:
undeployDefinition in interface WorkflowComponent
Parameters:
workflowDefinitionId - the id of the definition to undeploy

getDefinitions

public java.util.List getDefinitions()
Gets all deployed Workflow Definitions

Specified by:
getDefinitions in interface WorkflowComponent
Returns:
the deployed workflow definitions

getAllDefinitions

public java.util.List getAllDefinitions()
Description copied from interface: WorkflowComponent
Gets all deployed Workflow Definitions (with all previous versions)

Specified by:
getAllDefinitions in interface WorkflowComponent
Returns:
the deployed (and previous) workflow definitions

getDefinitionById

public WorkflowDefinition getDefinitionById(java.lang.String workflowDefinitionId)
Description copied from interface: WorkflowComponent
Gets a Workflow Definition by unique Id

Specified by:
getDefinitionById in interface WorkflowComponent
Parameters:
workflowDefinitionId - the workflow definition id
Returns:
the deployed workflow definition

getDefinitionByName

public WorkflowDefinition getDefinitionByName(java.lang.String workflowName)
Description copied from interface: WorkflowComponent
Gets a Workflow Definition by unique name

Specified by:
getDefinitionByName in interface WorkflowComponent
Parameters:
workflowName - workflow name e.g. jbpm$wf:review
Returns:
the deployed workflow definition

getAllDefinitionsByName

public java.util.List getAllDefinitionsByName(java.lang.String workflowName)
Description copied from interface: WorkflowComponent
Gets all (including previous) Workflow Definitions for the given unique name

Specified by:
getAllDefinitionsByName in interface WorkflowComponent
Parameters:
workflowName - workflow name e.g. jbpm$wf:review
Returns:
the deployed workflow definition (or null if not found)

getDefinitionImage

public byte[] getDefinitionImage(java.lang.String workflowDefinitionId)
Description copied from interface: WorkflowComponent
Gets a graphical view of the Workflow Definition

Specified by:
getDefinitionImage in interface WorkflowComponent
Parameters:
workflowDefinitionId - the workflow definition id
Returns:
graphical image of workflow definition

getTaskDefinitions

public java.util.List getTaskDefinitions(java.lang.String workflowDefinitionId)
Description copied from interface: WorkflowComponent
Gets the Task Definitions for the given Workflow Definition

Specified by:
getTaskDefinitions in interface WorkflowComponent
Parameters:
workflowDefinitionId - the workflow definition id
Returns:
the deployed task definitions (or null if not found)

getProcessDefinition

protected org.jbpm.graph.def.ProcessDefinition getProcessDefinition(org.jbpm.db.GraphSession graphSession,
                                                                    java.lang.String workflowDefinitionId)
Gets a jBPM process definition

Parameters:
graphSession - jBPM graph session
workflowDefinitionId - workflow definition id
Returns:
process definition

startWorkflow

public WorkflowPath startWorkflow(java.lang.String workflowDefinitionId,
                                  java.util.Map parameters)
Description copied from interface: WorkflowComponent
Start a Workflow Instance

Specified by:
startWorkflow in interface WorkflowComponent
Parameters:
workflowDefinitionId - the workflow definition id
parameters - the initial set of parameters used to populate the "Start Task" properties
Returns:
the initial workflow path

getActiveWorkflows

public java.util.List getActiveWorkflows()
Gets all "in-flight" active workflow instances.

Specified by:
getActiveWorkflows in interface WorkflowComponent
Returns:
the list of "in-flight" workflow instances

getCompletedWorkflows

public java.util.List getCompletedWorkflows()
Gets all completed workflow instances.

Specified by:
getCompletedWorkflows in interface WorkflowComponent
Returns:
the list of "in-flight" workflow instances

getWorkflows

public java.util.List getWorkflows()
Gets all workflow instances (both active and completed).

Specified by:
getWorkflows in interface WorkflowComponent
Returns:
the list of "in-flight" workflow instances

getActiveWorkflows

public java.util.List getActiveWorkflows(java.lang.String workflowDefinitionId)
Gets all "in-flight" active workflow instances of the specified Workflow Definition

Specified by:
getActiveWorkflows in interface WorkflowComponent
Parameters:
workflowDefinitionId - the workflow definition id
Returns:
the list of "in-flight" workflow instances

getCompletedWorkflows

public java.util.List getCompletedWorkflows(java.lang.String workflowDefinitionId)
Gets all "in-flight" completed workflow instances of the specified Workflow Definition

Specified by:
getCompletedWorkflows in interface WorkflowComponent
Parameters:
workflowDefinitionId - the workflow definition id
Returns:
the list of "in-flight" workflow instances

getWorkflows

public java.util.List getWorkflows(java.lang.String workflowDefinitionId)
Gets all "in-flight" workflow instances (both active and completed) of the specified Workflow Definition

Specified by:
getWorkflows in interface WorkflowComponent
Parameters:
workflowDefinitionId - the workflow definition id
Returns:
the list of "in-flight" workflow instances

getWorkflowById

public WorkflowInstance getWorkflowById(java.lang.String workflowId)
Gets a specific workflow instances

Specified by:
getWorkflowById in interface WorkflowComponent
Parameters:
workflowId - the id of the workflow to retrieve
Returns:
the workflow instance

getProcessInstance

protected org.jbpm.graph.exe.ProcessInstance getProcessInstance(org.jbpm.db.GraphSession graphSession,
                                                                java.lang.String workflowId)
Gets a jBPM Process Instance

Parameters:
graphSession - jBPM graph session
workflowId - workflow id
Returns:
process instance

getWorkflowPaths

public java.util.List getWorkflowPaths(java.lang.String workflowId)
Description copied from interface: WorkflowComponent
Gets all Paths for the specified Workflow instance

Specified by:
getWorkflowPaths in interface WorkflowComponent
Parameters:
workflowId - workflow instance id
Returns:
the list of workflow paths

getPathProperties

public java.util.Map getPathProperties(java.lang.String pathId)
Description copied from interface: WorkflowComponent
Gets the properties associated with the specified path (and parent paths)

Specified by:
getPathProperties in interface WorkflowComponent
Parameters:
pathId - workflow path id
Returns:
map of path properties

cancelWorkflow

public WorkflowInstance cancelWorkflow(java.lang.String workflowId)
Description copied from interface: WorkflowComponent
Cancel an "in-flight" Workflow instance

Specified by:
cancelWorkflow in interface WorkflowComponent
Parameters:
workflowId - the workflow instance to cancel
Returns:
an updated representation of the workflow instance

deleteWorkflow

public WorkflowInstance deleteWorkflow(java.lang.String workflowId)
Description copied from interface: WorkflowComponent
Delete an "in-flight" Workflow instance

Specified by:
deleteWorkflow in interface WorkflowComponent
Parameters:
workflowId - the workflow instance to cancel
Returns:
an updated representation of the workflow instance

signal

public WorkflowPath signal(java.lang.String pathId,
                           java.lang.String transition)
Description copied from interface: WorkflowComponent
Signal the transition from one Workflow Node to another within an "in-flight" process.

Specified by:
signal in interface WorkflowComponent
Parameters:
pathId - the workflow path to signal on
Returns:
the updated workflow path

fireEvent

public WorkflowPath fireEvent(java.lang.String pathId,
                              java.lang.String event)
Description copied from interface: WorkflowComponent
Fire custom event against specified path

Specified by:
fireEvent in interface WorkflowComponent
Parameters:
pathId - the workflow path to fire event on
event - name of event
Returns:
workflow path (it may have been updated as a result of firing the event

getTasksForWorkflowPath

public java.util.List getTasksForWorkflowPath(java.lang.String pathId)
Description copied from interface: WorkflowComponent
Gets all Tasks associated with the specified path

Specified by:
getTasksForWorkflowPath in interface WorkflowComponent
Parameters:
pathId - the path id
Returns:
the list of associated tasks

getTimers

public java.util.List getTimers(java.lang.String workflowId)
Description copied from interface: WorkflowComponent
Gets all active timers for the specified workflow

Specified by:
getTimers in interface WorkflowComponent
Returns:
the list of active timers

hasWorkflowImage

public boolean hasWorkflowImage(java.lang.String workflowInstanceId)
Description copied from interface: WorkflowComponent
Determines if a graphical view of the workflow instance exists

Specified by:
hasWorkflowImage in interface WorkflowComponent
Parameters:
workflowInstanceId - the workflow instance id
Returns:
true if there is a workflow instance diagram available

getWorkflowImage

public java.io.InputStream getWorkflowImage(java.lang.String workflowInstanceId)
Description copied from interface: WorkflowComponent
Gets a graphical view of the workflow instance

Specified by:
getWorkflowImage in interface WorkflowComponent
Parameters:
workflowInstanceId - the workflow instance id
Returns:
image view of the workflow instance as an InputStream or null if a diagram is not available

getAssignedTasks

public java.util.List getAssignedTasks(java.lang.String authority,
                                       WorkflowTaskState state)
Description copied from interface: TaskComponent
Gets all tasks assigned to the specified authority

Specified by:
getAssignedTasks in interface TaskComponent
Parameters:
authority - the authority
state - filter by specified workflow task state
Returns:
the list of assigned tasks

getWorkflowTasks

protected java.util.List getWorkflowTasks(org.hibernate.Session session,
                                          java.util.List rows)

getPooledTasks

public java.util.List getPooledTasks(java.util.List authorities)
Description copied from interface: TaskComponent
Gets the pooled tasks available to the specified authority

Specified by:
getPooledTasks in interface TaskComponent
Returns:
the list of pooled tasks

queryTasks

public java.util.List queryTasks(WorkflowTaskQuery query)
Description copied from interface: TaskComponent
Query for tasks

Specified by:
queryTasks in interface TaskComponent
Parameters:
query - the filter by which tasks are queried
Returns:
the list of tasks matching the specified query

getWorkflowTasks

protected java.util.List getWorkflowTasks(java.util.List tasks)

getTaskInstance

protected org.jbpm.taskmgmt.exe.TaskInstance getTaskInstance(org.jbpm.db.TaskMgmtSession taskSession,
                                                             java.lang.String taskId)
Gets a jBPM Task Instance

Parameters:
taskSession - jBPM task session
taskId - task id
Returns:
task instance

updateTask

public WorkflowTask updateTask(java.lang.String taskId,
                               java.util.Map properties,
                               java.util.Map add,
                               java.util.Map remove)
Description copied from interface: TaskComponent
Update the Properties and Associations of a Task

Specified by:
updateTask in interface TaskComponent
Parameters:
taskId - the task id to update
properties - the map of properties to set on the task (or null, if none to set)
add - the map of items to associate with the task (or null, if none to add)
remove - the map of items to dis-associate with the task (or null, if none to remove)
Returns:
the update task

startTask

public WorkflowTask startTask(java.lang.String taskId)
Description copied from interface: TaskComponent
Start the specified Task Note: this is an optional task operation. It may be used to track when work started on a task as well as resume a suspended task.

Specified by:
startTask in interface TaskComponent
Parameters:
taskId - the task to start
Returns:
the updated task

suspendTask

public WorkflowTask suspendTask(java.lang.String taskId)
Description copied from interface: TaskComponent
Suspend the specified Task

Specified by:
suspendTask in interface TaskComponent
Returns:
the update task

endTask

public WorkflowTask endTask(java.lang.String taskId,
                            java.lang.String transition)
Description copied from interface: TaskComponent
End the Task (i.e. complete the task)

Specified by:
endTask in interface TaskComponent
Parameters:
taskId - the task id to end
Returns:
the updated task

getTaskById

public WorkflowTask getTaskById(java.lang.String taskId)
Description copied from interface: TaskComponent
Gets a Task by unique Id

Specified by:
getTaskById in interface TaskComponent
Parameters:
taskId - the task id
Returns:
the task

getStartTask

public WorkflowTask getStartTask(java.lang.String workflowInstanceId)
Description copied from interface: TaskComponent
Gets all active timers for the specified workflow

Specified by:
getStartTask in interface TaskComponent
Returns:
the list of active timers

compileProcessDefinition

protected org.alfresco.repo.workflow.jbpm.JBPMEngine.CompiledProcessDefinition compileProcessDefinition(java.io.InputStream definitionStream,
                                                                                                        java.lang.String mimetype)
Construct a Process Definition from the provided Process Definition stream

Parameters:
workflowDefinition - stream to create process definition from
mimetype - mimetype of stream
Returns:
process definition

getJbpmId

protected long getJbpmId(java.lang.String id)
Get JBoss JBPM Id from Engine Global Id

Parameters:
id - global id
Returns:
JBoss JBPM Id

getWorkflowToken

protected org.jbpm.graph.exe.Token getWorkflowToken(org.jbpm.db.GraphSession session,
                                                    java.lang.String pathId)
Get the JBoss JBPM Token for the Workflow Path

Parameters:
session - JBoss JBPM Graph Session
pathId - workflow path id
Returns:
JBoss JBPM Token

getTaskProperties

protected java.util.Map getTaskProperties(org.jbpm.taskmgmt.exe.TaskInstance instance,
                                          boolean localProperties)
Gets Properties of Task

Parameters:
instance - task instance
properties - properties to set

getTaskProperties

protected java.util.Map getTaskProperties(org.jbpm.taskmgmt.exe.TaskInstance instance,
                                          boolean localProperties,
                                          java.util.Map variablesCache)
Gets Properties of Task

Parameters:
instance - task instance
properties - properties to set
variablesCache - cahce of context instance variables if any exists

setTaskProperties

protected void setTaskProperties(org.jbpm.taskmgmt.exe.TaskInstance instance,
                                 java.util.Map properties)
Sets Properties of Task

Parameters:
instance - task instance
properties - properties to set

setDefaultTaskProperties

protected void setDefaultTaskProperties(org.jbpm.taskmgmt.exe.TaskInstance instance)
Sets Default Properties of Task

Parameters:
instance - task instance

setDefaultStartTaskDescription

public void setDefaultStartTaskDescription(org.jbpm.taskmgmt.exe.TaskInstance instance)
Sets default description for the Task

Parameters:
instance - task instance

setDefaultWorkflowProperties

protected void setDefaultWorkflowProperties(org.jbpm.taskmgmt.exe.TaskInstance startTask)
Initialise Workflow Instance properties

Parameters:
startTask - start task instance

getMissingMandatoryTaskProperties

protected org.alfresco.service.namespace.QName[] getMissingMandatoryTaskProperties(org.jbpm.taskmgmt.exe.TaskInstance instance)
Get missing mandatory properties on Task

Parameters:
instance - task instance
Returns:
array of missing property names (or null, if none)

createWorkflowPath

protected WorkflowPath createWorkflowPath(org.jbpm.graph.exe.Token token)
Creates a Workflow Path

Parameters:
token - JBoss JBPM Token
wfInstance -
node -
Returns:
Workflow Path

createWorkflowPath

protected WorkflowPath createWorkflowPath(org.jbpm.graph.exe.Token token,
                                          WorkflowInstance wfInstance,
                                          WorkflowNode node)
Creates a Workflow Path

Parameters:
token - JBoss JBPM Token
wfInstance -
node -
Returns:
Workflow Path

createWorkflowNode

protected WorkflowNode createWorkflowNode(org.jbpm.graph.def.Node node)
Creates a Workflow Node

Parameters:
node - JBoss JBPM Node
Returns:
Workflow Node

createWorkflowTransition

protected WorkflowTransition createWorkflowTransition(org.jbpm.graph.def.Transition transition)
Create a Workflow Transition

Parameters:
transition - JBoss JBPM Transition
Returns:
Workflow Transition

createWorkflowInstance

protected WorkflowInstance createWorkflowInstance(org.jbpm.graph.exe.ProcessInstance instance)

createWorkflowInstance

protected WorkflowInstance createWorkflowInstance(org.jbpm.graph.exe.ProcessInstance instance,
                                                  WorkflowDefinition definition,
                                                  java.util.Date endDate,
                                                  java.util.Map variables)
Creates a Workflow Instance

Parameters:
instance - JBoss JBPM Process Instance
endDate -
variables -
Returns:
Workflow instance

createWorkflowDefinition

protected WorkflowDefinition createWorkflowDefinition(org.jbpm.graph.def.ProcessDefinition definition)
Creates a Workflow Definition

Parameters:
definition - JBoss Process Definition
Returns:
Workflow Definition

createWorkflowTask

protected WorkflowTask createWorkflowTask(org.jbpm.taskmgmt.exe.TaskInstance task)
* Creates a Workflow Task

Parameters:
task -
Returns:

createWorkflowTaskDefinition

protected WorkflowTaskDefinition createWorkflowTaskDefinition(org.jbpm.taskmgmt.def.Task task)
Creates a Workflow Task Definition

Parameters:
task - JBoss JBPM Task
Returns:
Workflow Task Definition

createWorkflowDeployment

protected WorkflowDeployment createWorkflowDeployment(org.alfresco.repo.workflow.jbpm.JBPMEngine.CompiledProcessDefinition compiledDef)
Creates a Workflow Deployment

Parameters:
compiledDef - compiled JBPM process definition
Returns:
workflow deployment

createWorkflowTimer

protected WorkflowTimer createWorkflowTimer(org.jbpm.job.Timer timer)
Creates a Workflow Timer

Parameters:
timer - jBPM Timer
Returns:
workflow timer

getWorkflowTaskState

protected WorkflowTaskState getWorkflowTaskState(org.jbpm.taskmgmt.exe.TaskInstance task)
Get the Workflow Task State for the specified JBoss JBPM Task

Parameters:
task - task
Returns:
task state

getDefaultStartTaskType

protected org.alfresco.service.namespace.QName getDefaultStartTaskType()
Specified by:
getDefaultStartTaskType in class AlfrescoBpmEngine


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.