Warewolf Language


Explains how we use and refer to data in the Studio.
There are two kinds of information:
  • Scalar: An individual piece of information: [[VariableName]].
  • Recordset: Repeated information: [[Recordset(n).Field]]. n refers to the index of the recordset

Using Recordsets


[[Recordset(1).Field]]
As Input: Behaves exactly like a scalar. The value of "Field" in row/record 1 will be used.
As Result: Behaves exactly like a scalar. The value of "Field" in row 1 will be the value of the result.

[[Recordset().Field]] - no Index specified
As Input: Assumes the last index. The value of Field at the last index - so you don’t have to track it.
As Result: Assumes a new Index. Appends a new record to the end of the recordset.

[[Recordset(*).Field]]
As Input: Will execute each and every index in the Recordset.
As Result: Will write a result to each and every index starting at 1, until there are no more results.

[[Recordset()]] - no Field
As Input: Used in some tools to process specific recordsets.
As Result: Never

Hints:

Tools:
Tools are designed to make life easy: indicate * in a Recordset for Input to process every record

Workflow Services:
To move a Recordset from one workflow to another simply: map it in with a *.

Input data or Variable To Service
[[People(*).Name]] [[People(*).SecondNames]] Family(*).FName
[[People(*).Surname]] Family(*).SName
Springfield, Oregon Family(*).Town

E.g.

.Name
.SecondNames .Surname
People(1) Marjorie Anne Agnes Simpson
.Name .SecondNames .Surname
People(2) Bart Oscar Simpson


Will become:

.FName .SName .Town
Family(1) Marjorie Anne Agnes Simpson Springfield, Oregon
Family(2) Bart Oscar Simpson Springfield, Oregon

DB, Webservice and Plugins endpoints are outside the control of Warewolf. If you enter a * we will cram all the info into that input field. If you want to shape the data first, use the JSON or XML tool. You can put multiple * recordset fields into the same input field by simply typing them in:

“[[Family(*).LName]], [[Family(*).FName]] – [[Family(*).Nickname]] | “ in a single field will give you: “Simpson, Bartholomew – Bart | Simpson, Marjorie – Marge | …” etc.

Language Summary:


[[Scalar]] [[Rec (*).Field]] [[Rec ().Field]] - no Index [[Rec(n).Field]]
Input Value Every Index value Last Index Value Value at index "n"
Result New Value Every Index overwritten Value Into New Index Value at index "n"

Cet article vous a-t-il été utile ?