Feature #7301
Updated by Ivan Necas about 10 years ago
Foreman tasks should support triggering an action on a set of resources
and tracking the progress of the sub-tasks.
h2. Implementation
There is a @::Actions::BulkAction@:
<pre>
plan_action(::Actions::BulkAction, ActionToTriggerPerTarget, targets, *args)
</pre>
This will plan the @ActionToTriggerPerTarget@ on every target from the
targets. By default, it uses the targets class and the id of the
targets for serializing the data into the input and loading the
objects back in the run phase. The *args are also passed as arguments
to the @ActionToTriggerPerTarget@.
To customize the logic around serialization/deserialization of the
input targets and args, one can override the @plan@ and
@create_sub_plans@ method.
The @Task@ model has parent_task reference to the task that planned it.
In bulk action task details there is a link to a list of subtasks
(@/tasks/uuid/sub_tasks@), and in the sub task details, there is link
to the parent task.