I’m trying to test a bpmn flow where I have a connector which has an interrupt boundary timer attached to it. The timer then goes to a bpmn error exception like so:
To test the exception scenario what I am trying to do, is defining the timer duration with PT1S and then when the test runs I am hanging the connector execution by 10 seconds. The timer however is not being triggered.
Another approach that i tried was to execute the timer job when the process reaches the connector task. But once I use the ‘RuntimeService’ to instantiate a new process:
for this flow I must use the service task as connector instead of external as the logic is implemented in a java class. is there other way I could validate if the connector takes too long and redirect the flow to the exception?
No, it isn’t. You can just add transaction boundaries before or after a service task implemented with connectors. But the attached boundary events needs a transaction boundary after creating the service task.
You could also do the time management in java. If you detect that the call lasts for too long, you have all the options open as to how to signal it. But be aware that you’ll have to work with two threads which might bring camunda transaction management off the path. You have to check what happens then.