Class FlowableUserRequestHandler
java.lang.Object
org.apache.syncope.core.flowable.impl.FlowableUserRequestHandler
- All Implemented Interfaces:
UserRequestHandler
@Transactional(propagation=REQUIRES_NEW,
rollbackFor=java.lang.Throwable.class)
public class FlowableUserRequestHandler
extends Object
implements UserRequestHandler
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
protected final UserDataBinder
protected final DomainProcessEngine
protected final EntityFactory
protected static final Logger
protected final UserDAO
-
Constructor Summary
ConstructorDescriptionFlowableUserRequestHandler
(UserDataBinder dataBinder, String adminUser, DomainProcessEngine engine, UserDAO userDAO, EntityFactory entityFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel
(ProcessInstance procInst, String reason) Cancel a running user request.void
cancelByProcessDefinition
(String processDefinitionId) Cancel all running user requests for the given process definition id.void
cancelByUser
(EntityLifecycleEvent<Entity> event) Cancel all running user requests for the user in the given delete event.Claim a form for a given object.protected long
countProcessInstances
(StringBuilder processInstanceQuery) protected StringBuilder
createProcessInstanceQuery
(String userKey) protected static FormPropertyType
fromFlowableFormType
(FormType flowableFormType) Get the form matching the provided task id.protected UserRequestForm
protected UserRequestForm
getForm
(org.flowable.task.api.history.HistoricTaskInstance task) protected UserRequestForm
getForm
(org.flowable.task.api.Task task) protected UserRequestForm
getForm
(org.flowable.task.api.Task task, TaskFormData fd) org.springframework.data.domain.Page
<UserRequestForm> Get the forms matching the provided parameters.protected org.springframework.data.domain.Page
<UserRequestForm> getForms
(org.flowable.task.api.TaskQuery query, org.springframework.data.domain.Pageable pageable) protected UserRequestForm
getHistoricFormTO
(String procInstId, String taskId, String formKey, List<org.flowable.engine.impl.persistence.entity.HistoricFormPropertyEntity> props) protected <T> T
getHistoricVariable
(List<org.flowable.variable.api.history.HistoricVariableInstance> historicVariables, String name, Class<T> valueRef) protected org.flowable.task.api.Task
protected String
getUserKey
(String procInstId) protected UserRequest
getUserRequest
(ProcessInstance procInst) org.springframework.data.domain.Page
<UserRequest> getUserRequests
(String userKey, org.springframework.data.domain.Pageable pageable) Get the running user requests matching the provided parameters.protected User
Parses the given execution id to find matching user request and owner.protected Pair
<org.flowable.task.api.Task, TaskFormData> start
(String bpmnProcess, User user, WorkflowTaskExecInput inputVariables) Starts a new user request, for the given BPMN process and user.submitForm
(UserRequestForm form) Submit a form.unclaimForm
(String taskId) Unclaim a form for a given object.
-
Field Details
-
LOG
-
dataBinder
-
adminUser
-
engine
-
userDAO
-
entityFactory
-
-
Constructor Details
-
FlowableUserRequestHandler
public FlowableUserRequestHandler(UserDataBinder dataBinder, String adminUser, DomainProcessEngine engine, UserDAO userDAO, EntityFactory entityFactory)
-
-
Method Details
-
createProcessInstanceQuery
-
countProcessInstances
-
getUserRequest
-
getUserRequests
@Transactional(readOnly=true) public org.springframework.data.domain.Page<UserRequest> getUserRequests(String userKey, org.springframework.data.domain.Pageable pageable) Description copied from interface:UserRequestHandler
Get the running user requests matching the provided parameters.- Specified by:
getUserRequests
in interfaceUserRequestHandler
- Parameters:
userKey
- user key (optional)pageable
- paging information- Returns:
- total number of user requests, list of user requests matching the provided parameters
-
lazyLoad
-
start
Description copied from interface:UserRequestHandler
Starts a new user request, for the given BPMN process and user.- Specified by:
start
in interfaceUserRequestHandler
- Parameters:
bpmnProcess
- BPMN processuser
- userinputVariables
- variables- Returns:
- data about the started request service, including execution id
-
parse
Description copied from interface:UserRequestHandler
Parses the given execution id to find matching user request and owner.- Specified by:
parse
in interfaceUserRequestHandler
- Parameters:
executionId
- execution id- Returns:
- matching user request and owner
-
cancel
Description copied from interface:UserRequestHandler
Cancel a running user request.- Specified by:
cancel
in interfaceUserRequestHandler
- Parameters:
procInst
- process instance for user requestreason
- reason to cancel the user request
-
cancelByProcessDefinition
Description copied from interface:UserRequestHandler
Cancel all running user requests for the given process definition id.- Specified by:
cancelByProcessDefinition
in interfaceUserRequestHandler
- Parameters:
processDefinitionId
- process definition id
-
cancelByUser
Description copied from interface:UserRequestHandler
Cancel all running user requests for the user in the given delete event.- Specified by:
cancelByUser
in interfaceUserRequestHandler
- Parameters:
event
- delete event
-
fromFlowableFormType
-
getForm
-
getForm
-
getForm
-
getUserKey
-
getHistoricFormTO
protected UserRequestForm getHistoricFormTO(String procInstId, String taskId, String formKey, List<org.flowable.engine.impl.persistence.entity.HistoricFormPropertyEntity> props) -
getForm
protected UserRequestForm getForm(String procInstId, String taskId, String formKey, List<FormProperty> props) -
getForm
Description copied from interface:UserRequestHandler
Get the form matching the provided task id.- Specified by:
getForm
in interfaceUserRequestHandler
- Parameters:
userKey
- user keytaskId
- task id- Returns:
- the form for the given task id
-
getForms
@Transactional(readOnly=true) public org.springframework.data.domain.Page<UserRequestForm> getForms(String userKey, org.springframework.data.domain.Pageable pageable) Description copied from interface:UserRequestHandler
Get the forms matching the provided parameters.- Specified by:
getForms
in interfaceUserRequestHandler
- Parameters:
userKey
- user key (optional)pageable
- paging information- Returns:
- total number of forms, list of forms matching the provided parameters
-
getForms
protected org.springframework.data.domain.Page<UserRequestForm> getForms(org.flowable.task.api.TaskQuery query, org.springframework.data.domain.Pageable pageable) -
parseTask
-
getTask
- Throws:
NotFoundException
-
claimForm
Description copied from interface:UserRequestHandler
Claim a form for a given object.- Specified by:
claimForm
in interfaceUserRequestHandler
- Parameters:
taskId
- Workflow task to which the form is associated- Returns:
- updated form
-
unclaimForm
Description copied from interface:UserRequestHandler
Unclaim a form for a given object.- Specified by:
unclaimForm
in interfaceUserRequestHandler
- Parameters:
taskId
- Workflow task to which the form is associated- Returns:
- updated form
-
getPropertiesForSubmit
-
getHistoricVariable
-
submitForm
Description copied from interface:UserRequestHandler
Submit a form.- Specified by:
submitForm
in interfaceUserRequestHandler
- Parameters:
form
- to be submitted- Returns:
- user updated by this form submit
-