|Table of Contents||Sections|
Cloud workflows consist of a sequence of statements. Each statement consists of one or more expressions. The first expression is the define...end block:
A cloud workflow may contain any number of definitions. The special definition called main is the entry point to the process.
Definitions are scoped by the file that contain them: two definitions in the same file cannot have the same name.
Inputs and Outputs
As shown in the snippet above a cloud workflow may specify arguments and return values. There can be zero or more arguments and zero or more return values. Arguments and return values can either be references (@server and @instance) or variables ($wait and $duration), the difference being that references contain resource collections while variables may contain a number, a string, a boolean, a time value, the special null value, an array or a hash (references are described in Cloud Workflow Resources and variables are described in Cloud Workflow Variables).
A cloud workflow may execute children definitions using the call keyword:
This run_application definition first initializes the @servers resources collection using a tag query then passes the collection of retrieved servers to the launch_servers definition above. The list of references and variables specified after the retrieve keyword matches the list after the return keyword of the definition. These references and variables are initialized with the return values of the definition (so in this example the reference @launched_instances of the caller is initialized with the value of the @instances reference returned by launch_servers). The names can match, but don't have to as shown in the example.
Note: Using retrieve is optional and can be skipped if the caller does not need the return values.
A cloud workflow is composed of statements. Each statement is in turn made of expressions. Statements are delimited by newlines, semi-colons or both. Comments all start with the # symbol. Any character following that symbol on the same line is part of the comment. Blank characters include tabs, spaces and newlines. There can be zero or more blank characters before and after a statement (pending there is a semi-colon if there is no newline). There can also be zero or more blank characters between arguments, operands, and keywords:
Sequences of statements are encapsulated in blocks. The outer block is the define...end block however blocks can be defined at any time using the sub keyword:
Using blocks as in the snippet above does not change anything to the execution of the Cloud Workflow (and is thus not that useful...). However, blocks can be used to define scopes for error handlers, timeouts, etc. Blocks also allow defining concurrent activities. For more information about blocks, see the Cloud Workflow Processes section.
As mentioned above, a statement consists of a series of expressions. There are four categories of expressions:
Expressions can be adorned with attributes. Attributes do not constitute an expression by themselves. For more information about attributes, see Attributes and Error Handling.
|RCL||Resources||► Cloud Workflows & Definitions||Variables||Attributes & Error Handling||Branching & Looping||Processes||Functions||Operators||Mapping|
© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.