AnsweredAssumed Answered

How to get already Deployed Process Definition

Question asked by pjainiit on Aug 4, 2017
Latest reply on Aug 17, 2017 by ryandawson

I want to get already Deployed Process Definition. I have created process in which there are 2 group and each group contains some user.

once a user logged in , one process is started by a user of first group and then he logged out.

After that second user logged in and claim the task which was started by first user so that he can complete that task.

 

My code is working fine till first user is starting a job. but then I am getting below error while I am trying to claim the task belong to second group.

 

org.activiti.bpmn.exceptions.XMLException: Error reading XML
at org.activiti.bpmn.converter.BpmnXMLConverter.convertToBpmnModel(BpmnXMLConverter.java:312)
at org.activiti.bpmn.converter.BpmnXMLConverter.convertToBpmnModel(BpmnXMLConverter.java:284)
at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:148)
at org.activiti.engine.impl.bpmn.deployer.ParsedDeploymentBuilder.createBpmnParseFromResource(ParsedDeploymentBuilder.java:96)
at org.activiti.engine.impl.bpmn.deployer.ParsedDeploymentBuilder.build(ParsedDeploymentBuilder.java:55)
at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:69)
at org.activiti.engine.impl.persistence.deploy.DeploymentManager.deploy(DeploymentManager.java:60)
at org.activiti.engine.impl.persistence.deploy.DeploymentManager.resolveProcessDefinition(DeploymentManager.java:131)
at org.activiti.engine.impl.persistence.deploy.DeploymentManager.findDeployedProcessDefinitionById(DeploymentManager.java:78)
at org.activiti.engine.impl.util.ProcessDefinitionUtil.getProcessDefinition(ProcessDefinitionUtil.java:49)
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Content is not allowed in prolog.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:604)
at org.activiti.bpmn.converter.BpmnXMLConverter.convertToBpmnModel(BpmnXMLConverter.java:309)
at org.activiti.bpmn.converter.BpmnXMLConverter.convertToBpmnModel(BpmnXMLConverter.java:284)
at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:148)
at org.activiti.engine.impl.bpmn.deployer.ParsedDeploymentBuilder.createBpmnParseFromResource(ParsedDeploymentBuilder.java:96)
at org.activiti.engine.impl.bpmn.deployer.ParsedDeploymentBuilder.build(ParsedDeploymentBuilder.java:55)
at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:69)
at org.activiti.engine.impl.persistence.deploy.DeploymentManager.deploy(DeploymentManager.java:60)
at org.activiti.engine.impl.persistence.deploy.DeploymentManager.resolveProcessDefinition(DeploymentManager.java:131)
at org.activiti.engine.impl.persistence.deploy.DeploymentManager.findDeployedProcessDefinitionById(DeploymentManager.java:78)

 

 

I think my program is not able to get process definition which was deployed in previous step.

Please let me know how can I get already deployed process definition, So that I can claim the task.

 

Below is the code I am using at the time second logged in user to claim the task.

 

ProcessEngineConfiguration processEngineConfiguration = ProcessEngineConfiguration
.createStandaloneProcessEngineConfiguration().setDatabaseType("postgres")
.setJdbcDriver("org.postgresql.Driver").setJdbcUsername("abcd").setJdbcPassword("abc@123")
.setJdbcUrl("jdbc:postgresql://127.0.0.1:5432/WorkFlowDB");

 

// Create Process Engine that connect to DB
this.processEngine = processEngineConfiguration.buildProcessEngine();
this.taskService = processEngine.getTaskService();
this.historyService = processEngine.getHistoryService();

 

List<Task> verifytasks =  taskService.createTaskQuery().taskTenantId("orgId").taskCandidateGroup("SecondGroup").list();


for (Task verifytask : verifytasks) {
taskService.claim(verifytask.getId(), userId);

}

 

Please help to find the reason of above error.

Outcomes