So let’s continue where we left it, we are going to analyze the “Schema” tab in depth.
First, we have a left pane with different items that we can drag & drop into the can space (right pane).
We can drag & drop various kind of items, like, scriptable tasks, actions and other Workflows.
This is the design of our Workflow, we have inserted scriptable tasks, a decision and a counter decrease.
We start checking what we’re doing on first item (Scriptable task). As you can see is very useful to put a description on every item, we are going to take the input “number” and copy the value to the attribute “numberTemp”, in that way we leave intact the input and we will work with “numberTemp”.
Select the input for the scriptable task.
The output.
No exception configured.
At “Visual Binding”, we can see really fast the relationship between, what gets in and what gets out. As you can imagine you cannot bind variables of different types. (We will see on future posts that here we can create inputs, outputs and attributes just with drag & drop)
Finally, we see the scripting code, this is an easy one (JavaScript).
Continuing with the next item, we will make a decision to take one way or another. As we are making a countdown, we want to know when we arrive to zero.
We setup the comparison, we take the “numberTemp” and check if equals zero.
If does not equal zero we will jump in to the way of “not true”, and go to next item “Log Value”.
Obviously this one will log the actual value of “numberTemp”.
“numberTemp” is an input and the output.
Again the visual binding.
Here you have how to log things at the Workflow execution log (There is also another option Server.log, they are different, we will explain more on that on future posts).
So let’s countdown with the help of a Decrease counter item.
We bind the counter to “numberTemp”, input and output.
This is the auto-generated code for Decrease counter item.
Then the workflow will return to the decision, this loop will occur until “numberTemp” equals zero.
When it equals zero we will take the way of “is true”.
Finally we do last step, add five to input number and log.
We need both inputs “number” and “numberTemp”.
As output “numberOut”, this one can be used in another Workflow if we concatenate Workflow executions.
As usual the bindings.
Scripting code.
So, let’s see this entire staff doing the job.
We want to make the countdown from 20, and then add 5.
After successful execution.
If we check the log.
That seems job DONE.
Finally, I want to remark that we can Schedule or debug the workflow not only start it.
I hope this post is a good point to start understanding the philosophy of vRO.
I will come back soon with a real life Workflow.
Thanks for sharing 🙂
Great post Juanvi, sure usefull to start automating tasks