<define>

This tag is used to define the procedure; it will register this definition in the global environment under the name provided to the procedure attribute.

An arbitrary number of attributes corresponding to parameters and return values can be set; each of these should take as their value a type string ("boolean", "int", "long", "double", "string", "file", "uri", "any", "object" – the last two are synonymous). Parameter arguments should begin with ARG_, return values with RET_.

When a procedure gets called, copies of the values given to its formal parameters are placed on its local frame under the name of the parameter, and the return value names are also declared on the local frame, so that they may be assigned to inside the procedure. Assignment of return values on a task-by-task basis then proceeds as usual. For example:

<define procedure="p0" ARG_0="int" ARG_1="long" ARG_2="object" RET_0="int" RET_1="long" RET_2="any">
        <consume-int value="${ARG_0}">
           <return-value assignedName="RET_0" defaultName="consumedValue"/>
        </consume-int>
        <consume-long value="${ARG_1}">
           <return-value assignedName="RET_1" defaultName="consumedValue"/>
        </consume-long>
        <consume value="${ARG_2}">
           <return-value assignedName="RET_2" defaultName="consumedValue"/>
        </consume>        
</define>
  • No labels