cancel
Showing results for 
Search instead for 
Did you mean: 

Custom BpmnParseHandler - duplicate activity error

pkromolowski
Champ in-the-making
Champ in-the-making
Hi,

After upgrading to 5.12 I get the following exception when parsing the process definition:

org.activiti.engine.ActivitiException: Error parsing XML
   at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:188)
   at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:86)
        ….
Caused by: org.activiti.engine.impl.pvm.PvmException: duplicate activity id 'usertask12'
   at org.activiti.engine.impl.pvm.process.ScopeImpl.createActivity(ScopeImpl.java:66)
   at org.activiti.engine.impl.bpmn.parser.handler.AbstractBpmnParseHandler.createActivityOnScope(AbstractBpmnParseHandler.java:97)

The problem occurs when I use a custom BpmnParseHandler AND a task within a subprocess (both conditions must be met to replicate the problem).
The custom parse handler doesn't do any processing, it simply calls super.XXX() methods
(ie.    
        @Override
   protected void executeParse(BpmnParse bpmnParse, UserTask userTask)
   {      
      super.executeParse(bpmnParse, userTask);
   }
)


The process gets parsed correctly when I disable all custom parse handlers. Ten processes without subprocesses are parsed correctly as well.

Thanks,
Przemek
7 REPLIES 7

jbarrez
Star Contributor
Star Contributor
What class does your BpmnParseHandler extend from?

pkromolowski
Champ in-the-making
Champ in-the-making
Hi,

It extends UserTaskParseHandler (it is a custom user task). Is this incorrect?

jbarrez
Star Contributor
Star Contributor
No, this will add some extra logic which is probably the cause of the issue.

Try to just implement the interface or the abstract class.

geoffb
Champ in-the-making
Champ in-the-making
Maybe worth a quick comment in the doco??

jbarrez
Star Contributor
Star Contributor

vinothkumar_j2e
Champ in-the-making
Champ in-the-making
looks like implementing BpmnParseHandler helps in executing some custom logic while the BPMN process is processed for the first time  or when server starts up. How to implement a global listener registered to application server spring config , so that every external notification to a BPMN process  can be listened with some event , that will trigger the listener and i can execute the custom logic ?

jbarrez
Star Contributor
Star Contributor
Then you would need to look into generic eventing frameworks. You can choose out hundreds there: JMS, Esper, RabbitMQ, Kafka, … totally not limited to Activiti itself.