Is there a way to get tasks in Activiti process definition without creating a process instance?

OutOfMind

I have to expose the Activiti API process using a service of my project.

My requirement is as under:

I want to know the details about Tasks in Activiti Process Definition, using Java, before running the Process, ie. before creating the Activiti ProcessInstance. Is there any way to achieve this?

I have gone through the Java docs and User guide of Activiti API lots of times but couldn't find a way.

Any help will be appreciated, Thanks.

Philippe Sevestre

You can use the getBpmnModel(processDefinitionId) method available in the RepositoryService interface.

The result is a Pojo that you can use in o order to introspect the process. The initial pojo represents the model, which can have multiple Processes (but usually only one). From a given Process, you can find all tasks using the findFlowElementsOfType(Class type).

For instance, this snippet should get you a list of UserTasks in a process (not tested but should give you an idea of what is needed):

BpmnModel model = processEngine.getRepositoryService().getBpmnModel(someProcessId);
List<Process> processes = model.getProcesses();
List<UserTask> userTasks = new ArrayList<>();
for( Process p : processes ) {
     userTasks.addAll( p.findFlowElementsOfType(UserTask.class))    
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

activiti - Terminate running process instance

How get the latest process definition of camunda irrespective of a process instance

Get all open user tasks for specified process instance in Camunda Zeebe

Process a list of tasks without concurrency

Activiti BPM: How can I get list of deleted process instance (task)

Alfresco Activiti - How to update a process definition in production/QA

How to get start and or end of year of a Carbon instance without modifying it in the process?

Creating a child process WITHOUT fork()

Activiti - Parent process of subprocess

Is there a way to globally WaitAll() for all tasks created by a process?

Use await without async to process tasks as they complete

Python - Get the process id of an instance

How to get process id in the method called by activiti:expression

Process.Start without creating a child process (port handle inheritance)?

Switch user without creating an intermediate process

Getting error on deploying the process definition in activiti-rest using java code

Apache Activiti Workflow Execution happens as a separate process or within the Activiti Process

How to get last part of URL to process in parent directory without creating a new child directory

is there any way to stop part of process without disturbing whole process?

Activiti : How to check if the current process instance is pending on a given intermediate message event

How to get the ID of the process instance in the controller?

Is there any way to kill a zombie process without reboot?

Is there a way to validate the build process parameters when editing the build definition in TFS?

Process Tasks in Order

What is Repeater Tasks process?

Get the public properties of a class without creating an instance of it?

What is the better way to implement a C# thread to process functions to get data on database without lock user interface

Easy way to get process information from a window

Easy way to get process information from a window