Understanding the PAC file format#

Overall Syntax

-- Comments are indicated by a lead pair of dashes

The start block defines which steps will begin the process. Multiple steps can be started concurrently by listing multiple starts

start is
    start "step-1"
    start "step-2"
end

Step blocks define steps and begin with a keyword for the kind of step and declare the name of the step. Steps are linked together by name, so every step must have a unique name.

plugin step "step-1" is
    ...   -- explained later
end

Steps define what action to take after the step ends depending on the outcome.

plugin step "step-1" is
    ...
on success
    -- actions when the step succeeds
    start "step-2"
on failure
    -- actions when the step fails
    start "step-3"
on complete
    -- actions when the step completes regardless of success or failure
    start "step-4"
end

Each outcome can specify multiple actions. The action 'finish' means to start the implicit finish step.

plugin step "step-1" is
    ...
on success
    start "step-2"
    start "step-3"
    start "step-4"
on failure
    finish

Certain steps allow nesting processes.

for-each-resource-tag step "frt1" is
    ... -- explained later

    start is
        start "step-1"
    end

    plugin step "step-1" is
        ...
    on success
        finish
    end
on success
    start "step-2"
end

Step names must unique across top-level and nested processes. Nested process steps may only reference their nest mates.

String Syntax

Strings are used to specify step names and other custom values. Strings are specified by text surrounded by double quote characters.

"single quote"

Special characters can be embedded by escaping with a backslash. Double quote, carriage return, new line, horizontal tab, and backslash itself may be escaped this way.

" \" \r \n \t \\ "

Strings can also be specified by triple quotes. These strings do not allow escape characters, but they can extend over multiple lines or embed other special characters without quoting. When using triple quotes, triple quotes must be placed on newline. This restriction may be lifted later.

"""
cd C:\workdir
copy *.* "C:\Program Files\My Program"
"""

Triple quotes can be embedded in a triple quote string by doubling.

""" """""" <- becomes " repeated 3 times """

Multi-line triple quoted strings have the leading indent removed, where the indent is determined by the identation of the opening triple quote.

For example,

    """
    for x in *.txt
    do
        echo $x
        cat $x
    done
    """

becomes

for x in *.txt
do
    echo $x
    cat $x
done

Implemented Step Types

These are the currently implemented step types. Refer to the main product documentation for more information about the behavior of each step in a process.

Any type of process can be defined with this language, but not all steps are valid in every type of process.

start

The start block is a pseudo-step that defines the beginning of the process. As it is not a true step, it does not use the step keyword. The only completion condition is success, so on success is not required or permitted.

start is
    -- list one or more actions
    start "foo"
    start "bar"
end

Parent topic: Process-as-code feature