Latest Posts

Topic: Problems with production site program: call - on failure

QCS

Topic Opener
Joined: 2009-12-29, 22:47
Posts: 256
Ranking
Tribe Member
Posted at: 2010-01-03, 22:24

In a production site's program I want to state the following:

[do1] sleep=20000 consume=goods worker=do_job1

[do2] sleep=5000 worker=do_job2

[work] call=do1 call=do2 return=skipped

This is in a production site which defines an input of goods. No I have the problem, that if the input queue is empty, the site's program is always stopped at call=do1 and fails, never going to call=do2.

In the "Widelands Productionsite Program Reference" document I found that there are failure handlers on the call command - on failure [fail|repeat|ignore] I suppose ignore is the one I want to use, but it doesn't work anymore, the engine says to use [fail|complete|skip|repeat]. There's no documentation on skip and complete, but neither one resolves my problem. Is this already implemented? I'm using quite recent SVN revision. What should I do to continue the [work] program to call=do2 if the input queue is empty for call=do1 ?

Sorry if this is the wrong forum for this topic.

Edited: 2010-01-03, 22:25

CMake is evil.

Top Quote
QCS

Topic Opener
Joined: 2009-12-29, 22:47
Posts: 256
Ranking
Tribe Member
Posted at: 2010-01-03, 22:37

Interesting way I found to make it work:

[do1] sleep=20000 worker=do_job1

[do2] sleep=5000 worker=do_job2

[work] call=do2 consume=goods call=do1 return=skipped

First call the do2, then consume, then call do1 in work, instead consuming it in do1. Nevertheless the documentation is outdated face-smile.png

NEVERMIND. This solution just worked once. Now it doesn't anymore :-( The problem is still open face-sad.png

Oh well... it works. This was an error at something else in the script... face-sad.png

Edited: 2010-01-03, 23:30

CMake is evil.

Top Quote
sigra

Joined: 2009-03-05, 19:02
Posts: 130
Ranking
At home in WL-forums
Location: Orsa
Posted at: 2010-01-04, 16:46

From the code it looks like the default is to continue the program no matter what result the called program returns.


Top Quote