how do I get all the start event definitions from a process definition? In a form of ActivityImpl or whatever.
Looked all RepositoryService and RuntimeService methods and didn’t find anything appropriate by name…
/fedd
PS. This is an org.camunda.bpm.engine.repository.ProcessDefinition taken from the repositoryService PD query, which isn;t even a ProcessDefinitionImpl, that seems to have the methods I need…
I am not sure if this is the best way of getting them but here you go:
// get all message event subscriptions
List<EventSubscription> list = runtimeService.createEventSubscriptionQuery().eventType("message").list();
// you need to cast to EventSubscriptionEntity to get the activity
EventSubscriptionEntity eventSubscription = (EventSubscriptionEntity) list.get(0);
ActivityImpl activity = eventSubscription.getActivity();
@yana.vasileva thanks, will try. I need to specify the process definition. My Netbeans freezes and crashes all the time, but eventually I will find if this query builder allows this.
@jangalinski I am marrying Camunda with Apache Camel. Sorry how it sounds. When you deploy another process with start message events, the previous version should be found and deactivated. Probably I will have to cache the start subscription ids so no problem