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.
Example | Description |
---|---|
<mix name="Mix"> <service name="Expr" provision="expr"/> <request name="FirstDivisor" service="Expr" fields="TEST"> <prop name="expr.src" content-type="text/x-erlang"><![CDATA[ put("div", 2), "Ok". ]]></prop> <reply name="Ok" fields="div"/> </request> </mix> 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 The last expression value has to name the reply set, in this case
The value 2 is used to populate the
|