public class WorkflowService extends Object implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.context.ApplicationListener<JahiaTemplateManagerService.ModuleDeployedOnSiteEvent>, ReadOnlyModeCapable
| Modifier and Type | Field and Description |
|---|---|
static String |
CANDIDATE |
static String |
START_ROLE |
static String |
WORKFLOWRULES_NODE_NAME |
| Constructor and Description |
|---|
WorkflowService() |
| Modifier and Type | Method and Description |
|---|---|
void |
abortProcess(String processId,
String provider)
This method will call the underlying provider to signal the identified process.
|
void |
addComment(String processId,
String provider,
String comment,
String user) |
void |
addProcessId(JCRNodeWrapper stageNode,
String provider,
String processId) |
void |
addProvider(WorkflowProvider provider)
Adds the specified workflow provider into the registry.
|
void |
addWorkflowListener(WorkflowListener listener) |
void |
addWorkflowRule(JCRNodeWrapper node,
String wfName) |
void |
addWorkflowRule(JCRNodeWrapper node,
WorkflowDefinition workflow) |
void |
assignAndCompleteTask(String taskId,
String provider,
String outcome,
Map<String,Object> args,
JahiaUser user) |
void |
assignAndCompleteTaskAsJob(String taskId,
String provider,
String outcome,
Map<String,Object> args,
JahiaUser user) |
void |
assignTask(String taskId,
String provider,
JahiaUser user) |
void |
completeTask(String taskId,
JahiaUser user,
String provider,
String outcome,
Map<String,Object> args) |
void |
deleteProcess(String processId,
String provider) |
List<Workflow> |
getActiveWorkflows(JCRNodeWrapper node,
Locale locale,
Locale displayLocale)
This method list all currently active workflow for the specified node.
|
Map<Locale,List<Workflow>> |
getActiveWorkflowsForAllLocales(JCRNodeWrapper node)
This method list all currently active workflow for the specified node.
|
List<JahiaPrincipal> |
getAssignedRole(WorkflowDefinition definition,
String activityName,
String processId) |
List<JahiaPrincipal> |
getAssignedRole(WorkflowDefinition definition,
String activityName,
String processId,
JCRSessionWrapper session) |
Set<WorkflowAction> |
getAvailableActions(String processId,
String provider,
Locale locale)
This method list all actions available at execution time for a node.
|
String |
getFormForAction(String definitionKey,
String action) |
HistoryWorkflow |
getHistoryWorkflow(String id,
String provider,
Locale uiLocale) |
List<HistoryWorkflow> |
getHistoryWorkflows(JCRNodeWrapper node,
Locale uiLocale)
Returns a list of process instance history records for the specified
node.
|
List<HistoryWorkflow> |
getHistoryWorkflowsByPath(String path,
Locale locale)
Returns a list of process instance history records for the specified
path.
|
List<HistoryWorkflowTask> |
getHistoryWorkflowTasks(String workflowProcessId,
String providerKey,
Locale uiLocale)
Returns a list of history records for workflow tasks.
|
static WorkflowService |
getInstance()
Returns a singleton instance of this service.
|
String |
getModuleForWorkflow(String key) |
WorkflowObservationManager |
getObservationManager() |
WorkflowDefinition |
getPossibleWorkflowForType(JCRNodeWrapper node,
boolean checkPermission,
String type,
Locale locale)
This method return the workflow associated to an type, for the specified node.
|
Map<String,WorkflowDefinition> |
getPossibleWorkflows(JCRNodeWrapper node,
boolean checkPermission,
Locale uiLocale)
This method list all possible workflows for the specified node.
|
Map<String,WorkflowProvider> |
getProviders()
Returns a map with the registered workflow providers.
|
int |
getReadOnlyModePriority()
Get the priority of the service.
|
List<WorkflowTask> |
getTasksForUser(JahiaUser user,
Locale uiLocale) |
Set<String> |
getTypesOfWorkflow() |
Workflow |
getWorkflow(String provider,
String id,
Locale displayLocale) |
WorkflowDefinition |
getWorkflowDefinition(String provider,
String id,
Locale locale) |
List<WorkflowDefinition> |
getWorkflowDefinitionsForType(String type,
JCRSiteNode siteNode,
Locale uiLocale)
Returns a list of available workflow definitions for the specified type.
|
List<WorkflowDefinition> |
getWorkflowDefinitionsForType(String type,
Locale uiLocale)
Returns a list of available workflow definitions for the specified type.
|
WorklowTypeRegistration |
getWorkflowRegistration(String definitionKey) |
WorkflowRule |
getWorkflowRuleForAction(JCRNodeWrapper objectNode,
boolean checkPermission,
String action) |
Collection<WorkflowRule> |
getWorkflowRules(JCRNodeWrapper objectNode) |
List<WorkflowDefinition> |
getWorkflows(Locale displayLocale)
This method list all workflows deployed in the system
|
List<Workflow> |
getWorkflowsForDefinition(String definition,
Locale uiLocale) |
List<Workflow> |
getWorkflowsForType(String type,
Locale uiLocale) |
List<Workflow> |
getWorkflowsForUser(JahiaUser user,
Locale uiLocale) |
WorkflowTask |
getWorkflowTask(String taskId,
String provider,
Locale displayLocale) |
String |
getWorkflowType(WorkflowDefinition def) |
boolean |
hasActiveWorkflowForType(JCRNodeWrapper node,
String type)
This method list all currently active workflow for the specified node.
|
void |
initAfterAllServicesAreStarted() |
protected WorkflowProvider |
lookupProvider(String key) |
void |
onApplicationEvent(JahiaTemplateManagerService.ModuleDeployedOnSiteEvent event) |
Object |
postProcessAfterInitialization(Object bean,
String beanName) |
Object |
postProcessBeforeInitialization(Object bean,
String beanName) |
void |
registerWorkflowType(WorklowTypeRegistration type)
Performs the registration of the provided workflow type.
|
void |
registerWorkflowTypes() |
void |
removeProcessId(JCRNodeWrapper stageNode,
String provider,
String processId) |
void |
removeProvider(WorkflowProvider provider)
Removes the specified provider from the registry.
|
void |
setCacheService(CacheService cacheService) |
void |
setJcrTemplate(JCRTemplate jcrTemplate) |
void |
start() |
String |
startProcess(List<String> nodeIds,
JCRSessionWrapper session,
String processKey,
String provider,
Map<String,Object> args,
List<String> comments) |
void |
startProcessAsJob(List<String> nodeIds,
JCRSessionWrapper session,
String processKey,
String provider,
Map<String,Object> args,
List<String> comments) |
void |
switchReadOnlyMode(boolean enable)
Enable/disable read-only mode for a specific functional area this ReadOnlyModeCapable is responsible for.
|
void |
unregisterWorkflowType(WorklowTypeRegistration type)
Performs the unregistration of the provided workflow type.
|
public static final String CANDIDATE
public static final String START_ROLE
public static final String WORKFLOWRULES_NODE_NAME
public static WorkflowService getInstance()
public void setCacheService(CacheService cacheService)
public void start()
throws JahiaInitializationException
JahiaInitializationExceptionpublic void registerWorkflowType(WorklowTypeRegistration type)
type - the helper object instance for registerng a new workflow typepublic void registerWorkflowTypes()
public void unregisterWorkflowType(WorklowTypeRegistration type)
type - the helper object instance for unregisterng a workflow typepublic Map<String,WorkflowProvider> getProviders()
public void addProvider(WorkflowProvider provider)
provider - a workflow provider to be registeredpublic void removeProvider(WorkflowProvider provider)
provider - the provider to be removedpublic List<WorkflowDefinition> getWorkflows(Locale displayLocale) throws javax.jcr.RepositoryException
displayLocale - the UI display localejavax.jcr.RepositoryException - in case of an errorpublic List<WorkflowDefinition> getWorkflowDefinitionsForType(String type, Locale uiLocale) throws javax.jcr.RepositoryException
type - workflow typeuiLocale - the locale used to localize workflow labels @return a list of available workflow definitions for the specified typejavax.jcr.RepositoryException - in case of an errorpublic List<WorkflowDefinition> getWorkflowDefinitionsForType(String type, JCRSiteNode siteNode, Locale uiLocale) throws javax.jcr.RepositoryException
type - workflow typesiteNode - site nodeuiLocale - the locale used to localize workflow labels @return a list of available workflow definitions for the specified typejavax.jcr.RepositoryException - in case of an errorpublic Map<String,WorkflowDefinition> getPossibleWorkflows(JCRNodeWrapper node, boolean checkPermission, Locale uiLocale) throws javax.jcr.RepositoryException
node - checkPermission - javax.jcr.RepositoryExceptionpublic WorkflowDefinition getPossibleWorkflowForType(JCRNodeWrapper node, boolean checkPermission, String type, Locale locale) throws javax.jcr.RepositoryException
node - checkPermission - javax.jcr.RepositoryExceptionpublic List<JahiaPrincipal> getAssignedRole(WorkflowDefinition definition, String activityName, String processId) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic List<JahiaPrincipal> getAssignedRole(WorkflowDefinition definition, String activityName, String processId, JCRSessionWrapper session) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic List<Workflow> getActiveWorkflows(JCRNodeWrapper node, Locale locale, Locale displayLocale)
node - locale - the content localedisplayLocale - the UI display localepublic Map<Locale,List<Workflow>> getActiveWorkflowsForAllLocales(JCRNodeWrapper node)
node - public Set<WorkflowAction> getAvailableActions(String processId, String provider, Locale locale)
processId - the process we want to advanceprovider - The provider executing the processlocale - public void abortProcess(String processId, String provider)
processId - the process we want to advanceprovider - The provider executing the processpublic void startProcessAsJob(List<String> nodeIds, JCRSessionWrapper session, String processKey, String provider, Map<String,Object> args, List<String> comments) throws javax.jcr.RepositoryException, org.quartz.SchedulerException
javax.jcr.RepositoryExceptionorg.quartz.SchedulerExceptionpublic String startProcess(List<String> nodeIds, JCRSessionWrapper session, String processKey, String provider, Map<String,Object> args, List<String> comments) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void addProcessId(JCRNodeWrapper stageNode, String provider, String processId) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic void removeProcessId(JCRNodeWrapper stageNode, String provider, String processId) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic List<WorkflowTask> getTasksForUser(JahiaUser user, Locale uiLocale)
public List<Workflow> getWorkflowsForDefinition(String definition, Locale uiLocale)
public void completeTask(String taskId, JahiaUser user, String provider, String outcome, Map<String,Object> args)
public void assignAndCompleteTaskAsJob(String taskId, String provider, String outcome, Map<String,Object> args, JahiaUser user) throws javax.jcr.RepositoryException, org.quartz.SchedulerException
javax.jcr.RepositoryExceptionorg.quartz.SchedulerExceptionpublic void assignAndCompleteTask(String taskId, String provider, String outcome, Map<String,Object> args, JahiaUser user)
public void addWorkflowRule(JCRNodeWrapper node, WorkflowDefinition workflow) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic WorkflowTask getWorkflowTask(String taskId, String provider, Locale displayLocale)
public HistoryWorkflow getHistoryWorkflow(String id, String provider, Locale uiLocale)
public List<HistoryWorkflow> getHistoryWorkflows(JCRNodeWrapper node, Locale uiLocale)
node - the JCR node to retrieve history records foruiLocale - the current UI localepublic List<HistoryWorkflow> getHistoryWorkflowsByPath(String path, Locale locale)
path - the Path of the node to retrieve history records forlocale - public List<HistoryWorkflowTask> getHistoryWorkflowTasks(String workflowProcessId, String providerKey, Locale uiLocale)
workflowProcessId - the process instance IDproviderKey - the workflow provider keyuiLocale - current UI display localeprotected WorkflowProvider lookupProvider(String key)
public boolean hasActiveWorkflowForType(JCRNodeWrapper node, String type)
node - type - public void addWorkflowRule(JCRNodeWrapper node, String wfName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic WorkflowRule getWorkflowRuleForAction(JCRNodeWrapper objectNode, boolean checkPermission, String action) throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionpublic Collection<WorkflowRule> getWorkflowRules(JCRNodeWrapper objectNode)
public void onApplicationEvent(JahiaTemplateManagerService.ModuleDeployedOnSiteEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<JahiaTemplateManagerService.ModuleDeployedOnSiteEvent>public WorkflowDefinition getWorkflowDefinition(String provider, String id, Locale locale)
public WorklowTypeRegistration getWorkflowRegistration(String definitionKey)
public String getWorkflowType(WorkflowDefinition def)
public void addWorkflowListener(WorkflowListener listener)
public Object postProcessBeforeInitialization(Object bean, String beanName)
postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessorpublic Object postProcessAfterInitialization(Object bean, String beanName)
postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessorpublic void setJcrTemplate(JCRTemplate jcrTemplate)
public WorkflowObservationManager getObservationManager()
public void initAfterAllServicesAreStarted()
public void switchReadOnlyMode(boolean enable)
ReadOnlyModeCapableswitchReadOnlyMode in interface ReadOnlyModeCapableenable - true in case the read-only mode should be enabled; false otherwisepublic int getReadOnlyModePriority()
ReadOnlyModeCapablegetReadOnlyModePriority in interface ReadOnlyModeCapableCopyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.