Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Getting started - Warewolf Syntax

A quick guide to using Warewolf Syntax and language!

  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Getting started - Warewolf Syntax

  1. 1. Getting Started Warewolf Syntax
  2. 2. 1. Each workflow is a web service end point, accessed from the outside by executing the web URL as a restful API 2. Tools, other workflows and data connectors can be mashed up in any way on the workflow design surface. 3. Variables are simply defined by typing them and using them: e.g. [[variablename]] 4. The Variable list defines if an item is an Input, and Output or Neither Warewolf allows you to easily and efficiently build and orchestrate web services & microservices Key Concepts:
  3. 3. The Warewolf Language / Syntax To manipulate and transform data, we use the system tools and service mashups. There are a few rules you need to follow when defining or naming variables: 1. Variables are defined by using [[ and ]] square braces. 2. Variables are CaSe SensistiVe. So [[this]] does not equal [[This]]. 3. Variables cannot have spaces in their names. So [[First Name]] is not allowed. 4. Variables are made up of alphanumeric characters as well as dashes (-) and underscores (_). 5. Variables must start with an alphabetical character.
  4. 4. 6. Objects must be prefixed with an @ symbol 7. If your variable is [[red]] in the input area, then it has not yet been added to the variable list, or it is in an error state. Check that it is not duplicated and that these rules are followed. 8. Nested braces are dealt with as they are typed at design time and not as they appear at run time. So [[[[Part]]]] will evaluate twice. [[Part]] (where the value is “[[Piece]]”) will evaluate only once. 9. Variables are unique for each service. Data is broken down into Scalars Recordsets Objects
  5. 5. Scalars The notation for a Scalar variable is [[VariableName]]. A use case could be [[Firstname]] = Bart and [[Surname]] = Simpson If an input for another service required the format “Surname, Firstname” then we would simply input like so “[[Surname]], [[Firstname]]” which would be the equivalent of “Simpson, Bart”
  6. 6. RecordsetsRecordsets are repeating variables which can have a number of different uses. The notion for a Recordset Variable is [[Recordset(n).Field]] , where n refers to the index of the recordset. Given we have the following Recordset Data: [[Family(1).Name]] = Homer [[Family(1).Surname]] = Simpson [[Family(2).Name]] = Marge [[Family(2).Surname]] = Simpson [[Family(3).Name]] = Lisa [[Family(3).Surname]] = Simpson
  7. 7. • As Input: Used when a tool needs to know a Recordset Name to perform work on, e.g. Count Records Tool or For Each Tool. • As Result: Recordsets are not used as Results [[Recordset()]] – Has no field name
  8. 8. [[Recordset(n).Field]] – n Exists • As Input: Recordsets behave exactly like a Scalar. This notation is used when getting information out of a recordset at a particular index. If n = 3, then the value of the field in row 3 will be used. [[FamilyMember]] would now = Simpson, Lisa • As Result: The Recordset behaves exactly like a Scalar. The value of the variable will be overwritten with the new output value.
  9. 9. [[Recordset(n).Field]] – If n Doesn’t Exist • As Input: An index that does not exist has a Null value, so an error is returned Error will occur when Debugged as Field 4 does not exist • As Result: Specifying an index that does not exist, will append NULL data up to that index and then the Result at that index – effectively creating the index. (n)
  10. 10. [[Recordset().Field]] – No Index • As input: Assumes the last index and inserts the value at that index. You do not need to track the last index. e.g. [[FamilyMember]] would now = Lisa • As result: Behaves exactly like Scalar. Appends one new record to the Recordset from the last index. [[Family(4).Name]] would now = Maggie and [[Family(4).Surname]] would now = Simpson
  11. 11. [[Recordset(*).Field]] • As Input: Will execute each and every index in the Recordset [[FamilyMember]] would now = Lisa • As Result: For every execution, the result would be written to the Recordset starting at index 1 until there are no more results. Every name in the Family Recordset will be Bart If indexes already exist then data at that index will be overwritten
  12. 12. The Language can also be used in a “concatenation” type way: [[Family(*).Surname]] – [[Family(*).Name]] in a single field will give you: “Simpson – Homer ” “Simpson – Marge “ “Simpson – Lisa “
  13. 13. Syntax Summary [Rec(n).Field]] – n Doesn’t exist Input – Null Output – Appends up to “n" [[Rec(*).Field] Input – All Output – All with Overwrite [[Rec().Field]] Input – Last Record Output – Appends new from last recordset [[Rec(n).Field]] – n Exists Input – Record at “n” Output – Record at “n”
  14. 14. Objects The notation for an Object variable is either [[Object.Property]] or [[Object(n).Property]], n refers to the index in an array of objects Given we have the following object data in the examples below: [[@Org.Name]] = Warewolf [[@Org.Location]] = Ireland [[@Org.Workers(1).Name]] = Bob [[@Org.Workers(1).Surname]] = Dill [[@Org.Workers(1).Age]] = 20 [[@Org.Workers(1).Gender]] = Male [[@Org.Workers(2).Name]] = Jane [[@Org.Workers(2).Surname]] = Doe [[@Org.Workers(2).Age]] = 30 [[@Org.Workers(2).Gender]] = Female
  15. 15. In the case of accessing non array properties, behaviour is the same as scalars and in the case of array’s the behaviour is the same as recordsets. The main difference being that properties can be object themselves which allows for multi-level data structures. The Assign Object tool is used to setup objects or directly manipulate the data in properties.
  16. 16. The Select and Apply Tool allows the extraction of Data into an alias that can then be used in any tool that can then update the property value. Download the 30-Day Trail from https://warewolf.io

    Soyez le premier à commenter

    Identifiez-vous pour voir les commentaires

A quick guide to using Warewolf Syntax and language!

Vues

Nombre de vues

388

Sur Slideshare

0

À partir des intégrations

0

Nombre d'intégrations

1

Actions

Téléchargements

2

Partages

0

Commentaires

0

Mentions J'aime

0

×