It is a very common scenario to integrate/trigger your workflow with an external application. With the help of ION APIs, we can do this.
The Context
Infor ION WF
Firstly, let’s create a very simple WF which will send a notification
to the user.
- Login to the ION Desk.
- Go to the Workflows menu in the Monitors and Workflows section. Then, Add New Workflow
- Give it a name “KG_WF_TriggerFromApp” and fill in the Description if you want.
- Click on the Start Icon in the WF designer canvas
to see the Workflow properties. Add below two parameters.
Name Type Input PurchageOrderNo STRING YES SourceApp STRING YES - Drag and Drop the Notification function between Stat and End of the workflow. Provide the following configuration in the Notification Properties section.
- In the Notification Tab,
- Give it a name.
- Enter the message, like “You have received a purchase order from [SourceApp]”. You can select the parameter SourceApp by hitting CTRL+SPACE in the message text box.
- Go to the Content tab and select the two parameters we created from the left table and add them to the right table. This is to include values of parameters in the notification.
- Go to the Distribution tab and add the User to be notified.
- Save the WF and activate it.
Infor ION API
Infor ION API provides a POST API under IONProcessApplicationServer
to start a workflow. The API has two required parameters;
- logicalId -to differentiate the application.
- StartWorkflowJSONBody – to specify WF Name, instance, input variables and structures.
Invoking the API
In this example, I’m using the Postman client to mimic the
external call. Refer
to my post to configure the Postman to call ION APIs.
- Create a new POST request in the Postman client.
- Paste the API endpoint from the ION API documentation. The URL is similar to https://[ Your CloudSuite URL and Tenent ]/IONSERVICES/process/application/v1/workflow/start .
- Add a Query Parameter as
- Go to the Body tab and add the following JSON payload and Send.
No comments:
Post a Comment