Skip to content

signal_action_failure

Marks an action as failed and stops or continues the containing plan depending on whether action is supplied.

<signal_action_failure reason="service_unavailable"/>

Attributes and placement

Attribute Meaning
reason Required result label used in the failure report; it is not an ontology declaration.
action Optional ontology action to mark failed instead of the containing goal's action.

The element has no children and can appear in a plan or conditional branch.

Behavior and examples

Without action, the containing perform goal is treated as failed, the remaining plan items stop, and the runtime emits a report of the form report(action_status(action, aborted(reason))). The reason is an identifier; it does not have to be declared in the ontology. With action, the runtime looks up the declared plan for that action and removes associated instructional goals. It reports the action as aborted only when the matching perform goal is active on the goals stack; otherwise, no abort report is queued. The containing plan can then continue. Use this form only when the named action has a declared plan and its perform goal is active.

Fail the containing goal:

<goal type="perform" action="call_someone">
  <plan><signal_action_failure reason="phone_not_available"/></plan>
</goal>

Fail an active action while allowing the containing goal to continue and complete:

<goal type="perform" action="cancel_calling">
  <plan>
    <signal_action_failure action="call_someone" reason="phone_not_available"/>
    <signal_action_completion/>
  </plan>
</goal>

The example shows the plan item syntax only; it does not create or activate the call_someone goal. The named-action form reports failure only when that action's matching perform goal is already active in the TDM goals stack.