08-04-2017 04:30 AM
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("jdbcostgresql://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.
08-14-2017 07:06 AM
Actually I see that you are already doing a query that doesn't involve process instance as you have 'taskService.createTaskQuery().taskTenantId("orgId").taskCandidateGroup("SecondGroup")' But I am guessing that if you add log statement to that second application to see where it fails it probably fails before that?
I imagine that you have the xml file on the classpath in both applications and the second application is failing during the engine's attempt to auto-deploy it? If so are applications 1 and 2 on different servers and are they using the same encoding? I take it there's a reason why you need to use two different applications instead of just one?
08-16-2017 06:16 AM
Is It possible for you to give sometime, So that we can sit and discuss the issue by screen sharing ?
I know the solution is quit simple but I am not getting it.
Or can you share some working example ?
My requirement :
There are 3 groups (Let say A , B , C )and Some users (Let say "a" belong to "A" , "b" belong to "B" and "c" belong to "C") are assigned to each group.
1) Once first user "a" logged in and start a process which is now forwarded to Group "B". And after that logged out. ( may be he started more than one task).
2) Now second user "b" logged in and Able to see all the task started by "a" because he belong to Group "B".
So, now first he claim the task so that it comes in his personal task list. and after that he complete it. So once he complete the task , now this task will be forwarded to Group "C". and he can now logged out.
3) Now any of user belong to Group "C" logged in and able to see task list completed by user "b".
And similar to above step. He can first claim the task and then he complete it and in this way first process ends.
So , you can think that once a new process is started by user "a" , a new process definition will be deployed having a new processInstanceId. and when user "b" logged in he can get deployed process of previous step having same processInstanceId. and he can resume the task and so on for user "c".
If you can share a sample code. It will be great.
Waiting for your response ...
08-17-2017 12:30 PM
So presumably if a user from group a starts the task then all of the subsequent actions have to be performed by somebody from group B or C (i.e. not A). That would appear to be much like the discussion at the bottom of . In that case you could follow the suggestion there to add a service task to dynamically set a variable and have the candidateGroup for the task set based on that variable.
Explore our Alfresco products with the links below. Use labels to filter content by product module.