Request

A request operation adds data needed to process a transaction.

Example XML code Notes

<request 
  name="FirstDivisor"
  service="Expr"  
  fields="n">
  <prop 
    name="expr.bind.out" 
    Div="div"/>
  <prop 
    name="expr.src" 
    content-type="text/x-erlang"><![CDATA[
      Div = 2,
      "Ok".
  ]]></prop>
  <reply 
    name="Ok"
    fields="div"/>
</request>
A request receives one or more fields from SPARKL and sends a reply based on the input.

There can be more than one reply to a request. Every time the operation is invoked, it sends only one reply. Each reply can add one or more fields.

For example, whenever it is invoked, FirstDivisor sends the field div with the value 2.

Note: The example is from a version of the Primes demo using the Expressions extension.

Attributes

A request operation must have a name, a service that implements it, and some fields the operation asks for as input.

name

The name of the component. Other components use this name to reference the component.

service

The service that implements the operation. The implementing service is referenced by its name.

fields

A space-separated list of fields received or output by the operation subject. Depending on the type of operation, they can be input or output fields. The fields are referenced by their name.

Children

A request must take one or more replies as its children. Depending on the service specified for it, the request can have one or more properties for additional functionality or field bindings too.

prop

A property defined for the component. For example, a Python or Erlang script. Most properties are specific to a SPARKL extension.

reply

A reply is a direct child of a request operation. A reply must have a name and it has to reference one or more fields it uses to carry the newly-generated data.