Hello,
if one "master task" starts a "sub task" and the the "sub task" gets an error, how can I get information about that in the "master task"?
Our case:
In my example the "master task" starts 4 "sub tasks" parallel which have to collect several data into some database tables. After that, "master task" triggers a reporting tool to create a report. In case that one of the "sub task" fails, the report is still being created, but without showing all necessary data.
Would can I do to stop the "master task" from continuing after the fail of one of its "sub tasks"?
Thank you.
Status from sub task?
Re: Status from sub task?
You can do this via global variables.
Look at this algorithm:
Master task starts slave task with waiting.
first step of slave task is
status = running
The last step
status = OK
So, master task starts slave task. When slave task is finished you can read the variable status.
If status contains running then this means that the task has been aborted on error
If you use several slave tasks use different global variables: status1, status2 and so on.
Look at this algorithm:
Master task starts slave task with waiting.
first step of slave task is
status = running
The last step
status = OK
So, master task starts slave task. When slave task is finished you can read the variable status.
If status contains running then this means that the task has been aborted on error
If you use several slave tasks use different global variables: status1, status2 and so on.
Oleg Yershov
Re: Status from sub task?
OK, I understand.
Could be necessary to maintain a huge number of global variables one day.
But as an alternative it's possible to write status information in local files or a database table.
Could be necessary to maintain a huge number of global variables one day.
But as an alternative it's possible to write status information in local files or a database table.
Re: Status from sub task?
Of course you can use external file or database by your own algorithm.
Oleg Yershov