In an event-driven flow, you identify an event that can occur in your source application and actions that can be performed in one or more target applications. The flow is triggered when the event occurs.
When prompted to log in to CP4I use the username and password provided to you for this lab.
In this section, we use App Connect Designer to create a flow that is triggered when an event occurs on ServiceNow records.
1. For this lab we will be using MQ to receive the events from App Connect so we will go and create a new Queue in are QMgr. Right click your qmgr and open in a new tab.
2. Now save the name of your QMgr and click on the tile to open that Qmgr dashboard.
3. Now we will create a new Queue to use in our new flow
4. We will be creating a new Local queue.
5. Enter the name for the Queue. In the example we used “SERVICENOW.USERS.EVENT” then click Create.
Save this info to be used to create the account in the MQ smart connector.
7. From the home page under Integrations, click on the App Connect Designer link to take you to the designer dashboard.
In the upper left, always make sure you are in the correct namespace. Select the tab on the left to open the Catalog screen.
8. Go down to the MQ connector and create a new account.
Use the MQ info you saved from above.
1. Click on the App Connect Designer Dashboard icon.
2. Select from the New drop down to create a new Event-driven flow.
3. First thing, enter a name that identifies the purpose of your flow (e.g., ServiceNow New User Events).
4. The connect to ServiceNow form will show. Fill in with the info from the pre-lab section at the beginning of this lab. Click Connect.
5. If you see the following error ignore and close it.
6. Now we will select the action we will be listening for. In this case, it will be whenever a New system user is created. Click on that.
7. Click on the second blue + and scroll down to IBM MQ connector. Select Put message on a queue.
8. Now you will see the fields that can be mapped for the target application.
9. Now you can see what will be put to the Queue payload for this event. Now we are ready to start the flow. In the upper right corner click on the 3-dots and start the flow.
We will now test the new Event flow. We will log into our ServiceNow developer account and create a new User.
1. Open a new tab and go to https://developer.servicenow.com/dev.do Follow the steps to login with your ServiceNow login.
2. Once logged into your ServiceNow developer instance, click Start Building.
3. You are now in the management screen. We will now add a new user which will trigger our AppConnect Event flow.
4. On the top menu, click the New button and fill-in the new record info. When done in the upper right corner, click the Submit button.
5. Now we will go back to the MQ console to check for messages on our Queue from this event.
6. We will now see that you have a new message on the SERVICENOW queue. Click on the Queue name to look at the message.
7. You will now see the message. Under the Application data, you will see the payload info that we mapped in the flow. Notice that the first thing is the SystemUserID. This is a unique id added to the record by ServiceNow when creating a new entry.
As in other labs, we can export our Designer flow as a bar file and deploy to App Connect Dashboard on Cloud Pak for Integration. We will not do that in this lab.