Custom Actions¶
In the Kelvin SDK there is a kelvin-publisher test tool to help you ingest data to the inputs and debug the outputs to test the performance of your Kelvin SmartApp™.
It is a CLI utility for exercising your application during development. It is not imported into your code and is used only as a standalone testing tool.
Note
You must have installed the kelvin-python-sdk[publisher] library for this feature to work.
You can use Custom Actions to enable communication between two Applications on either the same cluster or across different clusters.
Note
To understand the purpose of Custom Actions or view the overall structure of how they work, check out the documentation in the overview page here.
Once you have created a Consumer Application (Executor), you may want to test it first locally on your development computer before uploading it to the Kelvin Platform.
Generator Application¶
To test your Consumer Application (Executor), you will need to first create a local Generator Application.
Note
This Application is only for local testing and does not form part of your code to upload to the Kelvin Platform.
In our documentation examples in the Produce - Custom Actions and Consume - Custom Actions sections, we showed you the code to create Publisher and Consumer (Executor) Applications.
Here is a typical Generator Application you would create to send Custom Actions with the type email.
Test Consumer Application¶
With your Generator Application ready, you can now test your Consumer Application (Executor).
Note
In this example you would use the code from the Consumer Application example of the Custom Actions.
Note
Use the config.yaml file to override default configurations in app.yaml or inject sensitive information (API keys, credentials, etc.) that should not be embedded in your Kelvin SmartApp™.
Click here to read more about this local testing feature.
First in the terminal run the Generator Test Application.
| Start Generator Test Application | |
|---|---|
Then run your Consumer Application (Executor).
Warning
This is to test the Custom Action consumer application NOT the Custom Action publisher application.
The test generator is simulating a Custom Action publisher application.
Success
You can add Recommendation, Control Changes, etc. in your Consumer application. They will be received by the test generator and displayed in the terminal like a normal test.
| Start Testing Consumer Application | |
|---|---|
The Custom Action Objects created in the Generator Test Application will now be sent to the Consumer Application (Executor).