@Transactional(propagation=REQUIRES_NEW, rollbackFor=java.lang.Throwable.class) public class FlowableUserRequestHandler extends Object implements UserRequestHandler
Modifier and Type | Field and Description |
---|---|
protected String |
adminUser |
protected UserDataBinder |
dataBinder |
protected DomainProcessEngine |
engine |
protected EntityFactory |
entityFactory |
protected static org.slf4j.Logger |
LOG |
protected UserDAO |
userDAO |
protected WorkflowTaskManager |
wfTaskManager |
Constructor and Description |
---|
FlowableUserRequestHandler() |
Modifier and Type | Method and Description |
---|---|
void |
cancel(org.flowable.engine.runtime.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(AnyLifecycleEvent<Any<?>> event)
Cancel all running user requests for the user in the given delete event.
|
UserRequestForm |
claimForm(String taskId)
Claim a form for a given object.
|
protected int |
countProcessInstances(StringBuilder processInstanceQuery) |
protected StringBuilder |
createProcessInstanceQuery(String userKey) |
protected UserRequestFormPropertyType |
fromFlowableFormType(org.flowable.engine.form.FormType flowableFormType) |
protected UserRequestForm |
getForm(org.flowable.task.api.history.HistoricTaskInstance task) |
UserRequestForm |
getForm(String userKey,
String taskId)
Get the form matching the provided task id.
|
protected UserRequestForm |
getForm(String procInstId,
String taskId,
String formKey,
List<org.flowable.engine.form.FormProperty> props) |
protected UserRequestForm |
getForm(org.flowable.task.api.Task task) |
protected UserRequestForm |
getForm(org.flowable.task.api.Task task,
org.flowable.engine.form.TaskFormData fd) |
Pair<Integer,List<UserRequestForm>> |
getForms(String userKey,
int page,
int size,
List<OrderByClause> ob)
Get the forms matching the provided parameters.
|
protected Pair<Integer,List<UserRequestForm>> |
getForms(org.flowable.task.api.TaskQuery query,
int page,
int size,
List<OrderByClause> orderByClauses) |
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 Map<String,String> |
getPropertiesForSubmit(UserRequestForm form) |
protected org.flowable.task.api.Task |
getTask(String taskId) |
protected String |
getUserKey(String procInstId) |
protected UserRequest |
getUserRequest(org.flowable.engine.runtime.ProcessInstance procInst) |
Pair<Integer,List<UserRequest>> |
getUserRequests(String userKey,
int page,
int size,
List<OrderByClause> orderByClauses)
Get the running user requests matching the provided parameters.
|
protected User |
lazyLoad(User user) |
Pair<org.flowable.engine.runtime.ProcessInstance,String> |
parse(String executionId)
Parses the given execution id to find matching user request and owner.
|
protected Pair<org.flowable.task.api.Task,org.flowable.engine.form.TaskFormData> |
parseTask(String taskId) |
UserRequest |
start(String bpmnProcess,
User user,
WorkflowTaskExecInput inputVariables)
Starts a new user request, for the given BPMN process and user.
|
UserWorkflowResult<UserPatch> |
submitForm(UserRequestForm form)
Submit a form.
|
UserRequestForm |
unclaimForm(String taskId)
Unclaim a form for a given object.
|
protected static final org.slf4j.Logger LOG
@Autowired protected WorkflowTaskManager wfTaskManager
@Autowired protected UserDataBinder dataBinder
protected String adminUser
@Autowired protected DomainProcessEngine engine
@Autowired protected UserDAO userDAO
@Autowired protected EntityFactory entityFactory
protected StringBuilder createProcessInstanceQuery(String userKey)
protected int countProcessInstances(StringBuilder processInstanceQuery)
protected UserRequest getUserRequest(org.flowable.engine.runtime.ProcessInstance procInst)
@Transactional(readOnly=true) public Pair<Integer,List<UserRequest>> getUserRequests(String userKey, int page, int size, List<OrderByClause> orderByClauses)
UserRequestHandler
getUserRequests
in interface UserRequestHandler
userKey
- user key (optional)page
- result pagesize
- items per pageorderByClauses
- sort conditionspublic UserRequest start(String bpmnProcess, User user, WorkflowTaskExecInput inputVariables)
UserRequestHandler
start
in interface UserRequestHandler
bpmnProcess
- BPMN processuser
- userinputVariables
- variablespublic Pair<org.flowable.engine.runtime.ProcessInstance,String> parse(String executionId)
UserRequestHandler
parse
in interface UserRequestHandler
executionId
- execution idpublic void cancel(org.flowable.engine.runtime.ProcessInstance procInst, String reason)
UserRequestHandler
cancel
in interface UserRequestHandler
procInst
- process instance for user requestreason
- reason to cancel the user requestpublic void cancelByProcessDefinition(String processDefinitionId)
UserRequestHandler
cancelByProcessDefinition
in interface UserRequestHandler
processDefinitionId
- process definition idpublic void cancelByUser(AnyLifecycleEvent<Any<?>> event)
UserRequestHandler
cancelByUser
in interface UserRequestHandler
event
- delete eventprotected UserRequestFormPropertyType fromFlowableFormType(org.flowable.engine.form.FormType flowableFormType)
protected UserRequestForm getForm(org.flowable.task.api.Task task)
protected UserRequestForm getForm(org.flowable.task.api.Task task, org.flowable.engine.form.TaskFormData fd)
protected UserRequestForm getForm(org.flowable.task.api.history.HistoricTaskInstance task)
protected UserRequestForm getHistoricFormTO(String procInstId, String taskId, String formKey, List<org.flowable.engine.impl.persistence.entity.HistoricFormPropertyEntity> props)
protected UserRequestForm getForm(String procInstId, String taskId, String formKey, List<org.flowable.engine.form.FormProperty> props)
public UserRequestForm getForm(String userKey, String taskId)
UserRequestHandler
getForm
in interface UserRequestHandler
userKey
- user keytaskId
- task id@Transactional(readOnly=true) public Pair<Integer,List<UserRequestForm>> getForms(String userKey, int page, int size, List<OrderByClause> ob)
UserRequestHandler
getForms
in interface UserRequestHandler
userKey
- user key (optional)page
- result pagesize
- items per pageob
- sort conditionsprotected Pair<Integer,List<UserRequestForm>> getForms(org.flowable.task.api.TaskQuery query, int page, int size, List<OrderByClause> orderByClauses)
protected Pair<org.flowable.task.api.Task,org.flowable.engine.form.TaskFormData> parseTask(String taskId)
protected org.flowable.task.api.Task getTask(String taskId) throws NotFoundException
NotFoundException
public UserRequestForm claimForm(String taskId)
UserRequestHandler
claimForm
in interface UserRequestHandler
taskId
- Workflow task to which the form is associatedpublic UserRequestForm unclaimForm(String taskId)
UserRequestHandler
unclaimForm
in interface UserRequestHandler
taskId
- Workflow task to which the form is associatedprotected Map<String,String> getPropertiesForSubmit(UserRequestForm form)
protected <T> T getHistoricVariable(List<org.flowable.variable.api.history.HistoricVariableInstance> historicVariables, String name, Class<T> valueRef)
public UserWorkflowResult<UserPatch> submitForm(UserRequestForm form)
UserRequestHandler
submitForm
in interface UserRequestHandler
form
- to be submittedCopyright © 2010–2023 The Apache Software Foundation. All rights reserved.