Class WorkflowService
java.lang.Object
com.eurodyn.qlack.fuse.workflow.service.WorkflowService
This service provides methods related to the processes and workflow of
Activiti.
- Author:
- European Dynamics
-
Constructor Summary
ConstructorDescriptionWorkflowService
(org.activiti.engine.RuntimeService runtimeService, org.activiti.engine.HistoryService historyService, jakarta.persistence.EntityManager entityManager, ProcessInitService processInitService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteWorkflowInstance
(String processInstanceId, String reasonOfDeletion) Given the id of a started process instance, it deletes the found process instance.getProcessHistory
(String processId) Given the id of an existing process, it returns the history of this process and its data for each version.getProcessInstancesByProcessId
(String processId) Given the id of process, it returns all the active process instances.void
resumeWorkflowInstance
(String processInstanceId) Given the id of a suspended process instance, it resumes the process instance.startWorkflowInstance
(String processId, Map<String, Object> variables) Given the id of a process (as defined in the xml), a new workflow instance starts.void
suspendWorkflowInstance
(String processInstanceId) Given the id of a started process instance, it suspends the found process instance.void
This method reads the .xml files located under the resources/processes folder and reads their content.
-
Constructor Details
-
WorkflowService
@Autowired public WorkflowService(org.activiti.engine.RuntimeService runtimeService, org.activiti.engine.HistoryService historyService, jakarta.persistence.EntityManager entityManager, ProcessInitService processInitService)
-
-
Method Details
-
startWorkflowInstance
Given the id of a process (as defined in the xml), a new workflow instance starts. If no process with the found id exists, an exception is thrown.- Parameters:
processId
- the id of the processvariables
- the variables of the process- Returns:
- the id of the started workflow instance
-
resumeWorkflowInstance
Given the id of a suspended process instance, it resumes the process instance. If no instance is found or if the instance is already running, it throws an exception.- Parameters:
processInstanceId
- the id of the suspended process instance
-
suspendWorkflowInstance
Given the id of a started process instance, it suspends the found process instance. If no instance is found or if the instance is already suspended, it throws an exception.- Parameters:
processInstanceId
- the id of the started process instance
-
deleteWorkflowInstance
Given the id of a started process instance, it deletes the found process instance. If no instance is found, it throws an exception.- Parameters:
processInstanceId
- the id of the started process instancereasonOfDeletion
- the reason for deletion
-
getProcessInstancesByProcessId
Given the id of process, it returns all the active process instances.- Parameters:
processId
- the id of the process- Returns:
- a list containing the active process instances
-
getProcessHistory
Given the id of an existing process, it returns the history of this process and its data for each version. If no process is found, it returns an empty list.- Parameters:
processId
- the id of the process- Returns:
- a list containing all the history versions
-
updateProcessesFromResources
public void updateProcessesFromResources()This method reads the .xml files located under the resources/processes folder and reads their content. If their content has already been persisted in the Activiti tables and no changes are found, nothing happens. In any other case, a new version of the process is created.
-