/
Rule API Testing

Rule API Testing

Journey Orchestration provides functionality that can be used to automatically create test web pages that let users make calls to Live Rules using web APIs.

This allows Journey Orchestration users to create a Rule, have it automatically created and test it with the values that are expected (or not, to test logging or errors)

The Journey Orchestration user interface uses the same API that is exposed in the Rule API testing screen. However, the API testing screen only exposes a controlled subset of functionality, so that users can only complete the actions that are appropriate for their user profile.

Administrators can use the Rule API testing to see everything that is happening in Alterian CX and what is returned by the application. This provides a level of detail not provided by the UI that will help in the design and debug of Rules.

This screen was previously called the “Swagger” screen as this it the opensource functionality we use to create it.

Using Rule API Testing

There are two main Rule API Testing screens. To access them select API Help from the main menu on the left of the screen:

  • The page that is displayed when you select API Help from the frame menu lists all available DDE APIs and allows the user to call them. You can use this page to upload a template, to publish it as a Rule, to unpublish it, or to generate reports from DDE.

  • To access the second Rule API Testing screen, click the View published rules link at the bottom of the first API page. This page lists all RUNNING Rules and allows the user to invoke them manually. This view is also accessible from the Rules Screen and by clicking on Invoke within the ribbon bar within Rule Designer.

There are four kinds of message that can be sent to DDE:

  • GET - returns data and are low risk as they return results but do not change the underlying data.

  • PUT - makes changes to the server, so users should only use them on dev systems unless they are experienced users who know the implications of their actions. The DDE user interface also sends PUT messages that also include validation and confirmation messages, so the user is fully aware of the implications of their actions.

  • POST - same as PUT messages described above.

  • DELETE - unpublish Rules, remove templates etc.

Testing a Rule

Testing each Rule is simple. Simply click on the “Try it Out” button next to your rule enables the testing functionality.

Paste your API body into the Request body. Click on Execute and this will submit to the API.

The Response details including a Response code are shown below.

Adding Tracing

Tracing can be turned on within the Rule API Testing screen. This provides two options:

In essence the tracing functionality passes into the logs much fuller information on the fields and the field values. At this point you can choose to see this information at a Step level or a Tile level.

Tile will provide the extra information based on the movement between tiles in your Rule. This will make more sense when looking at your Rule in Rule Designer.

Step will show the enhanced detail based on the movement between Steps. Steps occur WITHIN a Tile and this makes it harder to compare to your Rule and therefore this is likely to be more useful to technical users.

 

Related content