cancel
Showing results for 
Search instead for 
Did you mean: 

API to get messageEventDefinition details

dharmesh
Champ in-the-making
Champ in-the-making
In order to signal or message intermediateCatchEvent I want my UI to get messageRef/signalRef.

How to scrap out messageEventDefinition(id, messageRef) information from intermediateCatchEvent if event gateway is active.

<eventBasedGateway eventGatewayType="Exclusive" gatewayDirection="Unspecified" id="_17" instantiate="false" name="Event Gateway">
        <incoming>_30</incoming>
        <outgoing>_19</outgoing>
        <outgoing>_22</outgoing>
</eventBasedGateway>
<sequenceFlow id="_19" sourceRef="_17" targetRef="_18"/>
<intermediateCatchEvent id="_18" name="Intermediate Catch Event" parallelMultiple="false">
        <incoming>_19</incoming>
        <outgoing>_20</outgoing>
        <messageEventDefinition id="_18_ED_1" messageRef="messageRef"/>
</intermediateCatchEvent>
2 REPLIES 2

dharmesh
Champ in-the-making
Champ in-the-making
My goal is for my UI code, knowing only the id of an intermediateCatchEvent to cause that gateway to open and move on to the "catch" task.  I don't think the UI should know the name of the message (the messageRef), that seems like an implementation detail, and since there can only be one messageRef, the messageRef should be implicit.

So, let's say I have:

<code>
<eventBasedGateway eventGatewayType="Exclusive" gatewayDirection="Unspecified" id="_17" instantiate="false" name="Event Gateway (Instantiate)">
        <incoming>_30</incoming>
        <outgoing>_19</outgoing>
        <outgoing>_22</outgoing>
      </eventBasedGateway>
      <sequenceFlow id="_19" sourceRef="_17" targetRef="_18"/>
      <intermediateCatchEvent id="_18" name="Intermediate Catch Event" parallelMultiple="false">
        <incoming>_19</incoming>
        <outgoing>_20</outgoing>
        <messageEventDefinition id="_18_ED_1" messageRef="messageRef"/>
      </intermediateCatchEvent>
</code>

Now, I have a handle to the PvmActivity for the intermediateCatchEvent that I was able to get via the id of the event gateway the UI passed to me.

From that, I need to get messageEventDefinition, specifically its messageRef.
Is this possible with the API?  How?  I'm not going to have to parse the BPMN XML, am I?

Thanks

trademak
Star Contributor
Star Contributor
Via the RepositoryService interface you can get the BpmnModel of a specific process definition. The BpmnModel contains a Java POJO model of the process definition, so you can use it to lookup the identifier. It's however not uncommon to have hardcoded reference to the message ref value.

Best regards,