This article explains how to set up an Application message queue so that it is accessible by an external system. This is useful when you need Process Automation to make information available to another system.
Setting up a queue can be useful in a variety of different applications. For example, if you want to add users to the AD in an onboarding application or if you want to send data to a billing system that needs to perform tasks synchronically.
By using a queue, you make it possible for an external system to poll Process Automation for updates. The information will only be added to the queue once it reaches the correct state in the process, making it possible to time when an action should be triggered in a third-party system. This means you can either collect information to be processed in batch if the incoming API call from the third party system only occurs occasionally, or it means you can collect information continuously if the polling takes place often.
The Application message feature needs to be activated on the contract. Please contact our sales department to activate this function.
- In Space settings navigate to the Business components tab and select Add new.
- From the drop-down, select Send Applicationmessage.
- Open your process in Process Studio and add an intermediate message to the process. Read more about Intermediate messages in the article Configuring Intermediate Events.
- Right-click on the intermediate message and choose Configure message, then navigate to the Other message tab.
- Add a queue name and a message. One example is to use this to retrieve data from a field in a form. You can achieve this by typing $form.field$. Then, select Copy queue name and past it into the agent.xml file (See step 6). Note: Messages that have been fetched from queue will be deleted after 30 days. Messages that have not been fetched from the queue within a year will automatically be deleted.
- Now it's time to configure the API call. Either via the BIA (Business Integration Agent) or a regular API Call. In this article, we will focus on configuration via the BIA (Agent.xml). If you wish to do a regular API call, you can find the API method for application message here.
Example of BIA configuration:
<?xml version="1.0" encoding="utf-8" ?>
<agent version="1.0">
<config id="Config1" enabled="true">
<apiurl>https://live.barium.se/api/v1.0</apiurl>
<apikey>00000000-0000-0000-0000-000000000000</apikey> <!-- Your private API Key -->
<apiusername>integration@company.se</apiusername>
<apipassword>****************</apipassword> <!--Your top secret password -->
<datasources>
<datasource id="SIGNAL1" adapter="applicationmessage">
<!--DomainId is the 4 digit number of the space.-->
<queryurl>https://live.barium.se/api/v1.1/domains/<domainId>/applicationmessages</queryurl>
<method>POST</method>
<body>
<!--Add the copied "Full queue name" from step 4 here.-->
{ "queueName" : "38c7c39b-abd5-4f81-96f1-2310a3c838d1.test_queue" }
</body>
</datasource>
</datasources>
<triggers>
<trigger id="trg" type="timer">
<period>0.00:05:00</period> <!-- Set the time how often the queue will be read.-->
</trigger>
</triggers>
<tasks>
<task trigger="trg" enabled="true">
<query id="signal1_queue" datasource="SIGNAL1"></query>
<foreach queryid="signal1_queue" as="queue_row">
<log>Signal received from Process Automation with data: id = $queue_row.id$, name = $queue_row.name$</log>
</foreach>
</task>
</tasks>
</config>
</agent>
Comments
0 comments
Article is closed for comments.