Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: ' -> " as per new kRL

...

You should have already completed  the following lessons:

...

Code Block
languagejs
themeConfluence
rule introduce_myself {
  select when pico_systems introduction_requested
  pre {
    sub_attrs = {
	  "name": event:attr("name"),
	  "name_space": "Closet",
	  "my_role": event:attr("my_role"),
	  "subscriber_role": event:attr("subscriber_role"),
	  "subscriber_eci": event:attr("subscriber_eci")
    };
  }
  if ( not sub_attrs{"name"}.isnull()
    && not sub_attrs{"subscriber_eci"}.isnull()
     ) then
  send_directive("subscription_introduction_sent")
    with options = sub_attrs
  fired {
    raise wrangler event '"subscription'" attributes sub_attrs;
    log "subcription introduction made"
  } else {
    log "missing required attributes " + sub_attr.encode()
  }
       
}

...

Code Block
languagejs
themeConfluence
 rule approve_subscription {
    select when pico_systems subscription_approval_requested
    pre {
      pending_sub_name = event:attr("sub_name");
    }
    if ( not pending_sub_name.isnull()
       ) then
       send_directive("subscription_approved")
         with options = {"pending_sub_name" : pending_sub_name
  		                }
   fired {
     raise wrangler event '"pending_subscription_approval'"
           with channel_name = pending_sub_name;
     log "Approving subscription " + pending_sub_name;
   } else {
     log "No subscription name provided"
   }
}

...

Code Block
languagejs
themeConfluence
rule remove_subscription {
  select when pico_systems subscription_deletion_requested
  pre {
    pending_sub_name = event:attr("sub_name");
  }
  if ( not pending_sub_name.isnull()
     ) then
       send_directive("subscription_approved")
         with options = {"pending_sub_name" : pending_sub_name }
 fired {
   raise wrangler event '"subscription_cancellation'"
         with channel_name = pending_sub_name;
   log "Approving subscription " + pending_sub_name;
 } else {
   log "No subscription name provided"
 }
}

...