Constant Operations pattern

A constant operation outputs constant values for a particular request- or consume-reply operation.

In the example in Table 1, a constant operation delivers the initial divisor 2 of any candidate prime number.

Table 1. Constant operation
Example Description
<mix name="Mix">
  <service name="Expr"  
  <request name="FirstDivisor"  
    <prop name="expr.src"
  put("div", 2),
    <reply name="Ok"    
Note: Do not manually type the <![CDATA...]]> delimiters. The Editor automatically renders text content as XML CDATA sections.
The service does not need a property.

The value of input fields, if they have such, is irrelevant.

The expr.src property has a list of Erlang expressions. These must be separated by commas and terminated by a full stop.

The last expression value has to name the reply set, in this case "Ok".

The value 2 is used to populate the div field sent in the reply.