Going one step deeper into coding
Using conditions require us to use a little of coding. But usually we will want to have deeper involvment of the coding layer and here is the place.
There is a full SDK chapter so this section is just a shallow dive to use the conditions.
Conditions based on previous execution results
In order to make next steps based upon previous execution results we first need to retrieve the process (using hard coded uuid) and from the process get the action object which is the actual executed part.
This methods returns the action object. You can learn more about the action object here.
function getAction(pId) { let p = getProcessById(pId)//Get the process. if(!p ||!p.length)return; p = p[p.length-1].actions; //Get all actions let action = p[Object.keys(p)[0]];//get the needed action return action }
Now that you have the action you can get the output such as
- action.result.result – the output of the command
- action.result.status – the status of the command – such as success, fail etc.