Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: link to code and add notice

...

When cleanup is needed, this rule will be selected. Line 3 gets all the member subscriptions and the rest of the rule loops over them, with each one in turn bound to the name subs. Lines 5-6 removes each subscription. Line 7, which is only evaluated when handling the last subscription, signals the collection pico's readiness for deletion.

Note
titlemade up events

Note that the events wrangler:deletion_imminent and wrangler:ready_for_deletion are fictional, in the sense that Wrangler does not raise the former event before a pico is deleted (whether manually or programmatically) and does not listen for the latter event. To use this rule, you would first send the first event (likely from the "Testing" tab) and then manually delete your collection pico.

Ruleset

The complete code for this ruleset can be found at https://raw.githubusercontent.com/Picolab/pico_lessons/master/collections/edu.byu.enMotion.collection.krl

Creating a collection pico

...

Repeating the action to create more collection picos give us a final configuration:

Ruleset

The complete code for this ruleset can be found at https://raw.githubusercontent.com/Picolab/pico_lessons/master/collections/edu.byu.enMotion.building.grouper.krl

Using a collection pico

Suppose we wanted to use one of the collection picos to collect some information from its member picos.

...