BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  Event not triggered by the message put in the eventqueue

    Posted Tue December 21, 2021 03:18 PM

    Hi All,

    There is an external application which notify us through a callback URL. We created a simple servlet which puts a message into the BAW's eventqueue to trigger the event "signOk" in process application "KLPOC" as a result of the call of the URL, but the event is never triggered :( .

    Here is the event:
    tw.local.message is a process variable with default value of "MSG", and the implementation of the attached UCA is a service with an input and output String parameter "message". It simply bypasses the message parameter and logs its value:

    So, theoretically the "signOk" event must be triggered in the application with acronym "KLPOC" when a message arrives into the BAW's eventqueue with the following content (using message parameter for correlation, and when it's value is equal to "MSG"):

    <eventmsg>
         <event processApp="KLPOC">signOk</event>
         <parameters>
              <parameter>
                   <key>message</key>
                   <value>MSG</value>
              </parameter>
         </parameters>
    </eventmsg>

    But nothing happens. The token is not moved, and there are no related log entries. What's wrong?
    Note: Running the message event using the "Run now" button of the UCA, it works: the token is moved to the next task of the process.

    Here is the code fragment of the servlet which places the message in the eventqueue:

    QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory)ctx.lookup("javax.jms.QueueConnectionFactory");
    Object ucaQueue = ctx.lookup("jms/eventqueue");
    QueueConnection connection = queueConnectionFactory.createQueueConnection(queueUser, queuePassword);
    Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
    MessageProducer producer = session.createProducer((Destination) ucaQueue);
    TextMessage ucaMessage = session.createTextMessage();
    ucaMessage.setText(message);
    producer.send(ucaMessage);

    where queueUser is the DEAdmin, queuePassword is its password, and message is like written above contains the process app acronym, the event name and the correlation value in the correlation parameter. There is no exception in the servlet, so I suppose that the message is placed in the queue successfully.

    So what's wrong? Why do not arrives the message to the event? BAW version is 19.x
    Any help appreciated!

    thx,



    ------------------------------
    Laszlo
    ------------------------------


  • 2.  RE: Event not triggered by the message put in the eventqueue

    Posted Wed December 22, 2021 04:18 AM
    Hi Laszlo,

    the documentation what's required is over here:
    https://www.ibm.com/docs/en/baw/20.x?topic=integrations-posting-message-business-automation-workflow-event-manager

    From a first glance, a few comments: 
    • in the Process you need a correlationKey parameter for the UCA  -> in my process I have used ProcessInstanceId for correlation which should be returned by the event:

    • for the event message, you are missing the the identificators for the exact UCA -> below is example from my ProcessApp, instead of '{{piid}}' the ProcessInstanceId for correlation should be provided:
    <eventmsg>
    <event processApp="PRCSD"ucaname="ReceiveSignedDocumentUCA">ReceiveSignedDocumentEventMessage</event>
    <parameters>
    <parameter>
    <key>processInstanceId</key>
    <value type="String">{{piid}}</value>
    </parameter>
    </parameters>
    </eventmsg>

    ------------------------------
    Tomas Dambrauskas
    ------------------------------



  • 3.  RE: Event not triggered by the message put in the eventqueue

    Posted Wed December 22, 2021 04:26 AM
    Hi,

    As you can see, I use correlation key:

    In the event there is the "message" parameter with value "MSG", and for the event it is set to correlate with the local variable tw.local.message with value "MSG".

    Az Android Outlook letöltése





  • 4.  RE: Event not triggered by the message put in the eventqueue

    Posted Wed December 22, 2021 05:44 AM
    Okay Guys, finally solved. Unfortunatelly the documentation is wrong (again) :(.

    When we use ucaname instead of event name (in reality it is not required), it works.
    In fact, the event name can be anything (empty too), it has no effect: the IME is triggered with empty or any event name.

    Bonus: if you don't specifiy processApp attribute for the event element, you get "Malformed Event Manager message: expected processAppShortName" error, although the attribute name isn't processAppShortName but processApp.

    ------------------------------
    Laszlo
    ------------------------------