cancel
Showing results for 
Search instead for 
Did you mean: 

Get processDefinition tasks , start event, end event using Java, without creating a process instance

mansi
Champ in-the-making
Champ in-the-making
Hi,
My requirement is to get the details about deployed processDefinition, like Tasks in it, its StartEvent, EndEvent.
But I want to have these without creating a process instance.
Is there a way to achieve this?
I have been looking into activiti user guide as well as javadocs, but couldn't find a way.
Any help will be appreciated. Thanks.
30 REPLIES 30

mansi
Champ in-the-making
Champ in-the-making
Also Martin mentioned above that there is no possibility to update a process definition once created. Is there a way to remove the process from BpmnModel using java? Although I couldn't find any such method, if it exists, it would solve my issue. Thanks.

jbarrez
Star Contributor
Star Contributor
"using BpmnModel, it has to be converted to xml for deployment, is that correct"

No, the repositoryService.createDeployment() takes in a BpmnModel.

"Is there a way to remove the process from BpmnModel using java"

Not sure what you mean by this?

mansi
Champ in-the-making
Champ in-the-making
I mean to say, once I do BpmnModel.addProcess(process), is there a way to remove/modify this process from the BpmnModel?

jbarrez
Star Contributor
Star Contributor
Once it's been deployed, no. Changing the process in the BPMNModel does not have impact on what's deployed.

mansi
Champ in-the-making
Champ in-the-making
Thank you so much for your help so far.

I wanted to know whether we can change the Activity_Id manually in Execution of the process,
I mean can we skip the next task in defined sequenceFlow and jump to some xyz task?

jbarrez
Star Contributor
Star Contributor
You can, but you'd have to write your own command (and execute it via the ManagementService), where you do the right database calls via the ExecutionEntityManager and such. Not supported out of the box.

sunitanayak83
Champ in-the-making
Champ in-the-making
I am using the Activiti designer to create and deploy a process in Activiti. My process gets deployed with no errors. But when I login to Activiti App, I am unable to start the process in my Task App.

Below are the logs from my Eclipse console :

Mar 18, 2016 2:22:31 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [activiti.cfg.xml]
Mar 18, 2016 2:22:34 PM org.activiti.engine.impl.ProcessEngineImpl
INFO: ProcessEngine default created
Mar 18, 2016 2:22:34 PM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource myProcess.bpmn20.xml
id 40005 myProcess:12:40004

Below is my Junit Test :

public void startProcess() throws Exception
{
RepositoryService repositoryService = activitiRule.getRepositoryService();
repositoryService.createDeployment().name("working set").addInputStream("myProcess.bpmn20.xml",
new FileInputStream(filename)).deploy();
RuntimeService runtimeService = activitiRule.getRuntimeService();

ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("myProcess");
assertNotNull(processInstance.getId());
System.out.println("id " + processInstance.getId() + " "
+ processInstance.getProcessDefinitionId());
}

I have assigned the task to $INITIATOR. The process starts successfully, but when I log into activiti-app as an administrator, I am unable to see the tasks in the task app. Why is that ?

mansi
Champ in-the-making
Champ in-the-making
Hey @jbarrez thanks a lot.
Is there a way to know whether a process was suspended at some point , after the processInstance is deleted?
I mean is there a way to know this through the history service?

jbarrez
Star Contributor
Star Contributor
@Mansi: no, sorry, that info is not stored anywhere.

mansi
Champ in-the-making
Champ in-the-making
Okay. Also I don't understand the use of Model class? Could you please explain it in brief.