{{run.percentComplete}} - is 100% complete 1 or 1.0 or 100?
Through some test runs, I have figured that a run that is 50% complete shows as as 0.5, when using the run.percentComplete global field.
What is the actual value when the run is 100% complete? I am guessing it is 1 ?
What I am using this for, is to check if the bot is stopped or stuck after say 5 minutes. It would then send the user an email.
So I have Field Formulas with
result = run.percent Complete
output field = percent-complete
Then in the conditions of the Send Email task, I have
If fields["percent-complete"] is less than 1
starting after a 5 minute delay
(The percent complete status will only register 100% after the bot has ended, so I would have to start another pushbot and look up the percent complete of a certain runID that I know ran to 100% complete, but I am having trouble finding the syntax for that. So I am just asking here.)
Is 1 correct?
thanks!
Best Answers
-
Hi Kevin,
Thank you for your question!I can confirm that percentComplete will be set to 1 when a run fully completes. Let me know if you have any further questions on this and I will be happy to help.
Thank you!
6 -
@Kevin_579059 what @Kalin_126161 said is correct, however I don't think using
percentComplete
will meet your needs well. The reason is the email step you are using is included in the percent complete calculations and, as you mention, it is not possible to look that value up for another run. The percent calculation is not granular enough to reliably determineHere are a few ideas:
1. Have a field formula on a delay without conditions and email step dependent on it with the condition based on some field value being set or the status of the last task in the process. If that task isn't complete/field isn't set, then send the email. We evaluate conditions before the task delays which is why you need the delay on the field formula
2. Have a field formula that runs after a delay that looks at all tasks except for the field formula & email step and make sure they are completevar taskNames = Object.keys(tasks).filter(taskName => taskName != "field-formula" && taskName != "send-email"); result = "complete"; taskNames.forEach(taskName => { var task = tasks[taskName]; if (task.status == "running" || task.status === "waiting") { result = "not complete"; } });
- If you are specifically concerned about fix tasks preventing the process from completing, there is a show and tell post that outlines how to monitor for fix tasks
6
Answers
-
Thank you, Kalin and Dylan!
I realized percentComplete will not work because it will never get to 100% (1) until all tasks are completed, including the two "dummy" tasks for checking the status and sending the email!
I also tried to check number of tasks completed versus total tasks, but that didn't work either because skipped tasks are not counted as completed (though when you look at the Instance, a skipped task is counted as completed).
So hence my question in the other post about task status. That will work!
thanks again0