Skip to main content

createTask

createTask creates a task. A task will be created for each object in the input set, with the object as the tasks target.

ContextType
Inputset of objects
Outputa set with a single object
ParameterType
nameThe name of the task.
descriptionA description of the task.
assignees (optional)The objects to assign to the created tasks

Examples

when 
object(type="bike", battery<20)
then
createTask("charge", "charge the bike", nearest(type="van"))

This example first finds bicycles with low battery, then creates a new task for each of them and assigns all of the tasks to the van that is nearest to any of them. In real life it may not make sense to assign a single van to every new low battery bike if the new low battery bikes are widely spread.