I’m trying to parse through a .bpmn file using the BPMN Model API, and I’m having trouble accessing the boolean “camunda.async” attribute on startEvents.
I’ve verified that my code is correctly identifying the startEvents, as event.getAttributeValue(“id”) on a startEvent event returns the correct id attribute on every startEvent I run it on. However, when I try event.getAttributeValue(“camunda:async”), I get null every time, regardless of whether or not the startEvent actually has an asynchronous before.
I’ve tried some variations on that code, trying to get something that works, but I haven’t been able to get anything other than null. For example, I’ve also tried:
I should have mentioned that ‘event’ in my example has type ModelElementInstance. I cast it to a StartEventImpl and tried isCamundaAsyncBefore( ) but it returns false, even though there is an asynchronous before associated with the start event. Again, I tried getting the id to verify, this time using .getId( ), and that correctly returned the id for the start event.
Should this be working, or am I misunderstanding some part of the code?
camunda:async is an deprecated attribute. It is technically the same as asyncBefore but as the model API is directly reading from the XML startEvent.isCamundaAsyncBefore() will not return the value of the async attribute. What you are searching for is startEvent.isCamundaAsync(). I hope this works.