Status from sub task?

Discuss RoboTask here
Post Reply
userXXX
Posts: 58
Joined: Wed Jun 11, 2014 8:45 am

Status from sub task?

Post by userXXX »

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.
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Status from sub task?

Post by Oleg »

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.
Oleg Yershov
userXXX
Posts: 58
Joined: Wed Jun 11, 2014 8:45 am

Re: Status from sub task?

Post by userXXX »

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.
Oleg
Site Admin
Posts: 3202
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Status from sub task?

Post by Oleg »

Of course you can use external file or database by your own algorithm.
Oleg Yershov
Post Reply