15.8. Data return by running actions (programs)
damcsud expects that each running action (program) can print a
result of its work on its stdout. If nothing is printed on stdout, the action can't
affect on a case state, for which it was run.
The work result of the action is printed as text lines. Each
line corresponds with the single event included in a case or if the
line consists of a single word: opened, it means, that a case should
be marked as opened (next actions, that will be run for this case
will receive an --opened argument). Another two exceptions are the
lines begining from the words closing-reason and closed-by. In the
first case the text following after keyword will be remebered and
next, it will be passed successive actions as an argument of
--closing-reason option. Similar situation is in the second case,
where the remembered identifier will be an argument of
--closed-by
option for succeccive actions. Each line included in a single event
consists of two items: an event identifier (an argument of each
--event-id option) and a code, that is a value of long type
(32-bit signed number). If the code is a positive value or
zero, the event is set as the active state. Otherwise its
state is set as passive. From all codes for each event which
an action has generated, the maximum code is selected but it
isn't lower then -1 and it's treated as a return code of this action.
If the return code is a positive number or zero, a modification time of a
given case is set as current time from which a number of seconds equals a return
code of the action is added (i.e. a modification time of a given case is elder
then current time about number of seconds equals a return code of the action).
At the end of a return code of the action is saved for a given case.