Set up a trigger
To get started with triggers, hover on the Start icon, and click the Settings icon that appears. A pop-up window will appear where you will see the list of trigger applications supported by IBM® webMethods Integration. Each of these applications has multiple triggers. Scroll down to locate the application you want, or search at the top if you have a specific application in mind.
In this case, we will look for Twitter and select it. This will redirect you to the trigger configuration window for Twitter.
Configure Twitter - New Tweet or Retweet Posted by Me trigger
We will now configure the New Tweet or Retweet Posted by Me trigger. To do this, enter details in the input fields as per the instructions given below:
-
Trigger Label: Provide a suitable name for this trigger. (For example, Twitter - New Tweet or Retweet Posted by Me.)
-
Select Trigger: Select the trigger, which when occurs, will fire off the workflow. For our example workflow, we will select New Tweet or Retweet Posted by Me. This trigger will start executing the workflow whenever you post a tweet via your Twitter account.
-
Authorize Twitter: Select the account you want to use to execute the action, from the drop‐down list. If you have not created an account yet, click on the + button. You will see two options:
-
Default Authorization: Select this option to allow IBM webMethods Integration to automatically generate all keys required to execute Twitter actions.
-
Or: select this option to provide the relevant keys required to execute all Twitter actions.
-
Select one of the options, provide the required information as prompted on the screen, and click Add.
This will create a new account for your Twitter account. Once you create an account, you can use it to execute all other Twitter actions and triggers.
Once you have entered all the details, click on SAVE to save your trigger.
This will create the specified trigger on IBM webMethods Integration and redirect you to the Test trigger window, where you can check if you have configured the trigger settings properly.
Test the configured trigger
To test your trigger, you need to perform the trigger event in the web service account for which you have set up the trigger (these instructions can be seen in the Test trigger window as well). For this example, go to your Twitter account and post a new tweet.
Once this is done, go back to your canvas in IBM webMethods Integration and click on the Test button given at the bottom of the Test trigger form IBM webMethods Integration will now fetch the data of the tweet that you just posted on your Twitter account.
If you have configured the trigger correctly, you will see the output data for the trigger. This will give you an idea of how your trigger will work when used in a workflow and which keys are returned in the output of the trigger. This output data will then be used to configure the rest of the workflow.
Alternatively, if you don't want to test the trigger, you can click the Skip button.
If you Skip testing the trigger, IBM webMethods Integration will use the mock data for that trigger to configure the rest of the workflow.
Set up filters for your trigger
You can also set custom filters to specify the conditions which must be met in order to execute the workflow. To do this, click on the filters link given at the bottom of the trigger output.
You will be redirected to the Filters window where you can set up conditions. Click Conditions to know more about how to set up conditions with filters.
Once you have entered all the details, click on DONE. And that's it! Your Twitter - New Tweet or Retweet Posted by Me trigger has been configured.
When you return to the canvas, you will notice that the start icon has now been replaced with the Twitter icon. This confirms that the Twitter trigger has been set up properly.
Let's now set up the action.