Class WorkflowRestImpl
- java.lang.Object
-
- org.alfresco.rest.workflow.api.impl.WorkflowRestImpl
-
- Direct Known Subclasses:
ActivitiesImpl
,DeploymentsImpl
,ProcessDefinitionsImpl
,ProcessesImpl
,TasksImpl
public class WorkflowRestImpl extends Object
Base class for rest-implementations related to workflow. Contains utility-methods that can be used, regardless of the type of resources the implementing class can handle.- Author:
- Frederik Heremans
-
-
Field Summary
Fields Modifier and Type Field Description protected org.activiti.engine.ProcessEngine
activitiProcessEngine
protected org.alfresco.service.cmr.security.AuthorityService
authorityService
protected static String
BPM_PACKAGE
protected boolean
deployWorkflowsInTenant
protected org.alfresco.service.cmr.dictionary.DictionaryService
dictionaryService
protected List<String>
excludeModelTypes
protected org.alfresco.service.namespace.NamespaceService
namespaceService
protected org.alfresco.service.cmr.repository.NodeService
nodeService
protected org.alfresco.repo.tenant.TenantService
tenantService
-
Constructor Summary
Constructors Constructor Description WorkflowRestImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Item
createItemForNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Item
createItemInProcess(String itemId, String processId)
Create a new item in the process package variablevoid
deleteItemFromProcess(String itemId, String processId)
Delete an item from the process package variableCollectionWithPagingInfo<FormModelElement>
getFormModelElements(org.alfresco.service.cmr.dictionary.TypeDefinition type, Paging paging)
Item
getItemFromProcess(String itemId, String processId)
Get an item from the process package variableCollectionWithPagingInfo<Item>
getItemsFromProcess(String processId, Paging paging)
Get all items from the process package variableorg.alfresco.service.cmr.repository.NodeRef
getNodeRef(String itemId)
Create NodeRef from item id String<T> T
getParameter(Parameters parameters, String parameterName, Class<T> returnType)
Get the first parameter value, converted to the requested type.protected Set<org.alfresco.service.namespace.QName>
getTypesToExclude(org.alfresco.service.cmr.dictionary.TypeDefinition taskType)
void
setActivitiProcessEngine(org.activiti.engine.ProcessEngine activitiProcessEngine)
void
setActivitiWorkflowEngine(org.alfresco.repo.workflow.activiti.ActivitiWorkflowEngine activitiWorkflowEngine)
void
setAuthorityService(org.alfresco.service.cmr.security.AuthorityService authorityService)
void
setDeployWorkflowsInTenant(boolean deployWorkflowsInTenant)
void
setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
void
setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
void
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
void
setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
protected List<org.activiti.engine.history.HistoricVariableInstance>
validateIfUserAllowedToWorkWithProcess(String processId)
Validates if the logged in user is allowed to get information about a specific process instance.
-
-
-
Field Detail
-
BPM_PACKAGE
protected static final String BPM_PACKAGE
- See Also:
- Constant Field Values
-
tenantService
protected org.alfresco.repo.tenant.TenantService tenantService
-
authorityService
protected org.alfresco.service.cmr.security.AuthorityService authorityService
-
namespaceService
protected org.alfresco.service.namespace.NamespaceService namespaceService
-
dictionaryService
protected org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
-
nodeService
protected org.alfresco.service.cmr.repository.NodeService nodeService
-
activitiProcessEngine
protected org.activiti.engine.ProcessEngine activitiProcessEngine
-
deployWorkflowsInTenant
protected boolean deployWorkflowsInTenant
-
-
Method Detail
-
setTenantService
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
-
setAuthorityService
public void setAuthorityService(org.alfresco.service.cmr.security.AuthorityService authorityService)
-
setNamespaceService
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
-
setActivitiProcessEngine
public void setActivitiProcessEngine(org.activiti.engine.ProcessEngine activitiProcessEngine)
-
setDeployWorkflowsInTenant
public void setDeployWorkflowsInTenant(boolean deployWorkflowsInTenant)
-
getNodeRef
public org.alfresco.service.cmr.repository.NodeRef getNodeRef(String itemId)
Create NodeRef from item id String
-
getItemsFromProcess
public CollectionWithPagingInfo<Item> getItemsFromProcess(String processId, Paging paging)
Get all items from the process package variable
-
getItemFromProcess
public Item getItemFromProcess(String itemId, String processId)
Get an item from the process package variable
-
createItemInProcess
public Item createItemInProcess(String itemId, String processId)
Create a new item in the process package variable
-
deleteItemFromProcess
public void deleteItemFromProcess(String itemId, String processId)
Delete an item from the process package variable
-
getParameter
public <T> T getParameter(Parameters parameters, String parameterName, Class<T> returnType)
Get the first parameter value, converted to the requested type.- Parameters:
parameters
- used to extract parameter value fromparameterName
- name of the parameterreturnType
- type of object to return- Returns:
- the converted parameter value. Null, if the parameter has no value.
- Throws:
IllegalArgumentException
- when no conversion for the given returnType is available or if returnType is null.InvalidArgumentException
- when conversion to the given type was not possible
-
getFormModelElements
public CollectionWithPagingInfo<FormModelElement> getFormModelElements(org.alfresco.service.cmr.dictionary.TypeDefinition type, Paging paging)
- Parameters:
type
- the type to get the elements forpaging
- Paging- Returns:
- collection with all valid form-model elements for the given type.
-
getTypesToExclude
protected Set<org.alfresco.service.namespace.QName> getTypesToExclude(org.alfresco.service.cmr.dictionary.TypeDefinition taskType)
- Parameters:
taskType
- type of the task- Returns:
- all types (and aspects) which properties should not be used for form-model elements
-
validateIfUserAllowedToWorkWithProcess
protected List<org.activiti.engine.history.HistoricVariableInstance> validateIfUserAllowedToWorkWithProcess(String processId)
Validates if the logged in user is allowed to get information about a specific process instance. If the user is not allowed an exception is thrown.- Parameters:
processId
- identifier of the process instance
-
createItemForNodeRef
protected Item createItemForNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
-
setActivitiWorkflowEngine
public void setActivitiWorkflowEngine(org.alfresco.repo.workflow.activiti.ActivitiWorkflowEngine activitiWorkflowEngine)
-
-