Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The ruleset wishing to create the subscription signals the CloudOS to do so by raising the system:subscribe event. This is most often done in a rule postlude as shown in the following example:
Code Block
themeConfluence
languagejavascript
fired {
  raise cloudos event subscribe
    with channelName   = "Coworkers Bob+Ted"
    and  namespace     = "MyFriends"
    and  relationship  = "friend-friend"
    and  targetChannel = "3f15b820-fa7f-012f-4c6e-00163ebccdcd"
    and  _api = "sky";
}

The CloudOS service raises the cloudos:subscriptionRequestAdded to the target cloud:

Code Block
themeConfluence
cloudos:subscriptionRequestAdded(targetChannel, backChannel, namespace, relationship, channelName)

 

The backChannel attribute contains an ECI for the originating cloud that the CloudOS service has created and will pass to the target cloud. 

The following rule would be selected upon seeing the cloudos:subscriptionRequestAdded event with appropriate values for the event attributes:

Code Block
themeConfluence
languagejavascript
rule process_subscriptionRequestAdded {
  select when cloudos subscriptionRequestAdded
    namespace re/MyFriends/"
    channelName re/Coworkers Bob+Ted/
    relationship re/friend-friend/
  ...
}

The CloudOS services in the target cloud raises the cloudos:subscriptionRequestPending to signal the receipt of a pending subscription request:

Code Block
themeConfluence
cloudos:subscriptionRequestPending(eventChannel, namespace, relationship, channelName)
 

Subscription Approval or Rejection

...

To approve the subscription request a ruleset in the the target cloud raises the cloudos:subscriptionRequestApproved event to signal the CloudOS service that the subscription is approved: 
Code Block
themeConfluence
cloudos:subscriptionRequestApproved(eventChannel)

For example, the following postlude would raise the cloudos:subscriptionRequestApproved event: 

Code Block
themeConfluence
languagejavascript
fired {
  raise cloudos event subscriptionRequestApproved
    with eventChannel = "3f15b820-af7f-012f-4c6e-00163ebcaaaa"
    and  _api = "sky";
}

Once the subscription request is approved, the CloudOS service in both the orginating and target clouds will raise the cloudos:CloudOS_subscriptionAdded event so that a ruleset can take additional actions once the subscription has been created

...