Plans and postplans¶
A plan is an ordered sequence of plan items for a goal. Items are represented in XML in execution order.
<goal type="perform" action="book_room">
<plan>
<findout type="wh_question" predicate="room_date"/>
<invoke_service_action name="BookRoom"/>
</plan>
</goal>
A postplan is an ordered sequence used after a resolve goal is resolved or downdated. Use it for follow-up bookkeeping, such as forgetting temporary information or moving to another goal. A jump from a completed goal's postplan does not restart that goal's source plan.
For example, a trip-price goal can collect its inputs in order, request the price, then clear the temporary result after the goal resolves:
<goal type="resolve" question_type="wh_question" predicate="price">
<plan>
<findout type="wh_question" predicate="means_of_transport"/>
<findout type="wh_question" predicate="destination"/>
<findout type="wh_question" predicate="departure_city"/>
<findout type="wh_question" predicate="departure_day"/>
<findout type="wh_question" predicate="seat_class"/>
<invoke_service_query type="wh_question" predicate="price"/>
</plan>
<postplan><forget predicate="price"/></postplan>
</goal>
Plan items can also occur in the then/else branches of if and inside once. See the plan-item index.