pasUnity RTM

Written By Gary Fletcher

Blogs pasUNITY Products

UPDATE: Last modified on 4/6/2017 2:37:25 PM

pasUnity RTM is now generally available.

This release adds a new token to the Remote Impeller and adds new functionality to macro writing and debugging.

When working with the Remote impeller there is now a {REMOTE-USER} token that can communicate the identity of the user that enqueued the impeller.  For impellers enqueued from the pasPortal the value of {REMOTE-USER} will be the logon name (email address) of the user as defined in pasPortal.  For instances of pasUnity that are not connected to the pasPortal for security the value of {REMOTE-USER} will be the Windows user name of the person enqueueing the work.

Macro parsing has been greatly enhanced to allow for the resolution of tokens and macros in multi-line strings of text.  This means that you can use job steps (such as the Create File step) to parse large documents in scenarios that previously were not possible. 

First you need to understand how tokens and macros are applied.  To begin, only those fields in pasUnity that have a yellow background will be parsed.  Some job steps (like the Create File and pretty much all the scripting job steps) have an optional Allow Macros toggle that toggles the background color of the editor controls and determines whether tokens and macros are even applied.  If tokens (the reserved words wrapped in {} such as {SYSTEM-DATE}) and macros (the functions wrapped in <> such as <Upper|Test>) are contained in the text that is parsed the tokens are evaluated before the macros and the macros are evaluated from right-to-left and child-to-parent order as nested.  Only those sequences that EXACTLY match a system defined token will be replaced.  That means that while {SYSTEM-DATE} would always get replaced with the current date the value {Hello there!} would do nothing because there is no token with such a definition in pasUnity.  Macro parsing is different though: any sequence of characters that begins with a < and ends with a > is going to be treated as macro command whether it is or not.  So how do you include sequences that look like macros but are not in your text?  Easy: use the % escape character to immediately prefix the macro start character < in your text and the entire sequence will be treated as text instead of as a macro.  The escape character is only need in text blocks to escape a macro start delimiter character but within macro blocks themselves it can be used to escape and macro delimiter character.

For debugging purposes you can enable the Configuration > Macro Tracing option on the main menu.  When active any macro expressions in jobs or job steps that you execute from within the designer will be audited to the trace window at the bottom of the screen with a detailed breakdown of the parsing to include all blocks allong with a designation of whether the block is Base (which represents the macro expression itselft), Text (which represents non-parsed blocks of text, and Macro (which represents code that follows the pattern for a macro command).

Tips and Tricks:
  • How do you get a token sequence to be treated like text instead of processed as a token?  Answer: stick a <Blank> macro in the middle of the token and at runtime it will not undergo token replacement and after macro parsing is complete only the original token code will remain.  Example:  {SYSTEM-DATE<Blank>} would yield {SYSTEM-DATE} instead of the actual date.
  • How do you include the macro start, separator, escape, or stop characters in the macro themselves without them being treated as a special delimiter character?  Answer: escape them by prefixing them with a single % character.  Example: <Upper|This is a %<macro%>> would yield: THIS IS A <MACRO> at runtime.

Follow Us

2023-12-06 12:12:06
© 2003 - 2023 pasUNITY, Inc. | Terms Of Use | Privacy Statement