svc_subr properties

The Subroutine extension lets you call slave transactions masked as a single operation in the master transaction.

subr.export

Use this property to offer a service, and the operations on it as subroutines, for other users. The subr.export property can be used on any service, not just those provisioned using svc_subr.

...

<service name="Subr3.2" 
  provision="subr">  
  <prop name="subr.export" 
    key="v3.2"/>
</service>

...
Important: A user can only import another user's SPARKL resources if he has execute rights.

key

Establishes a static configuration-based mapping between two or more services.

subr.import

Use this property to import a service, and the operations on the service, from a different configuration tree. The import is done using the user and key attributes.

...

<service name="ISR" 
  provision="subr">  
  <prop name="subr.import" 
    user="ios@cisco.com" 
    key="v3.2"/>
</service>

...
Important: A user can only import another user's SPARKL resources if he has execute rights.

key

Establishes a static configuration-based mapping between two or more services.

user

Specifies a user from whose account the service is imported.

subr.spec

Use this property to match a request or consume to a solicit or notify subroutine. The matching is done by specifying the same function for the operations and parameterising the fields. In the case of a solicit-request or solicit-consume/reply pairing, the number and name of the responses have to match the number and name of the replies.

...

<request name="Router1Version" 
  service="Subr" 
  fields="SOME_FIELD">  
  <prop name="subr.spec" 
    function="GetVersion" 
    ancestor="isr4453" 
    Version="router1_version"/>  
  <reply name="Ok" 
    fields="router1_version"/>
</request>   

...

<folder name="isr4453">    
  <solicit name="GetVersion" 
    service="Sequencer"
    clients="Subr"  
    fields="GET_VERSION ISR4453">    
    <prop name="subr.spec" 
      function="GetVersion" 
      Version="version"/>    
    <response name="Ok" 
      fields="version"/>  
  </solicit>

...
Tip: The subr.spec property can also contain Erlang extensions used as predicates.

function

The matching operations have to specify the same function. If the function attribute is not defined, the default value is used, which is the name of the operation. For example, function="Consume1".

Parameter

Parameter names have to be capitalised. The parameters specified in the caller operation has to be specified for the subroutine as well. The type of the fields mapped to the same parameter has to be the same.

ancestor

An optional attribute that can be used to specify a folder, to consider only those operations that are inside the given folder. Since a mix counts as a folder, it can also be used as a value for the ancestor attribute.