Page 1 of 1

Get tas title next task

Posted: Thu Aug 01, 2019 7:26 pm
by JosueTi
I solved it after routing, but I want to get it before routing, I attached the code for after routing

$consulta_task= executeQuery("
SELECT APP_TAS_TITLE FROM APP_CACHE_VIEW
WHERE DEL_LAST_INDEX = 1 AND APP_UID='".@@APPLICATION."'
");

$NEXT_TASK_NAME=$consulta_task[1]['APP_TAS_TITLE'];
@@NEXT_TASK_NAME=$NEXT_TASK_NAME;

Re: Get tas title next task

Posted: Thu Aug 01, 2019 9:20 pm
by amosbatto
It is only after routing that the record for the next task exists in the APP_CACHE_VIEW table, so that trigger will only work after routing.

Do you have a fixed route to the next task like this?
nextTaskFixedPath.png
nextTaskFixedPath.png (4.64 KiB) Viewed 3585 times
Or do you have a variable route to the next task like this?
nextTaskVariableTask.png
nextTaskVariableTask.png (13.39 KiB) Viewed 3585 times

Re: Get tas title next task

Posted: Mon Aug 05, 2019 10:33 am
by JosueTi
I have gateways on the process map as in the second example you show

Re: Get tas title next task

Posted: Mon Aug 05, 2019 6:53 pm
by amosbatto
JosueTi wrote: Mon Aug 05, 2019 10:33 am I have gateways on the process map as in the second example you show
The only way to know what will be next task in your situation is either fire a trigger after routing that looks at the APP_CACHE_VIEW or APP_DELEGATION table or you can execute the conditions in the gateway to figure out what will be the next task in the case.

For example, if your two conditions in the exclusive gateway are:
@#amount < 500.00
@#amount >= 500.00

Then, you could create a trigger like this to fire in "Current Task":
Code: Select all
if (@#amount < 500.00) {
   @@nextTask = 'Next Task 1';
}
else {
   @@nextTask = 'Next Task 2';
}