How to send execution messages to Cloud Factory
There was a question in the community as to how we can send out custom messages in the cloud factory and have them as part of the job logs. Below is my attempt to explain how we can do it.
Let’s directly get into the technical details. First define a Messages objects containing arrays, each one for Error, Information and Warnings, as below: – Please note: Better to define this in the first step of the scenario execution, so that you can start capturing in the subsequent steps.
Basically, it is used to append an additional element to the array. So, you could keep adding the messages in each of the array as per the scenario need.
Now, on carefully observing the Cloud factory logs, we realize that it is the snapshot of the variable “rootData”. And yes, we created our “Messages” object as part of the “rootData”. This way, we will get our “Messages” object in the cloud factory log automatically.
Another way: –
With the above way, you will get the messages at the bottom of the entire log, after all the page related item content is printed. If you are lazy like me to scroll down, then define similar structure in the context of the workflow as the first folder separately as below: –
Create an additional data variable in “rootData” for messages and that will automatically come up in the logs of cloud factory.