...
User defined actions may also return values. The returned value may be a string, map, array etc. Consider the following example that returns a map:
Code Block | ||||
---|---|---|---|---|
| ||||
deleteChild = defaction(pico_name){ ent_children = children(){"children"} child_collection = ent_children.collect(function(child){ (child{"name"} == pico_name) => "to_delete" | "dont_delete" }) child_to_delete = child_collection{"to_delete"}.head() every { engine:removePico(child_to_delete{"id"}) } return { "updated_children": child_collection{"dont_delete"}, "child": child_to_delete } } |
...