-OSGs default route expressed in the TJ's proposed new transform language. +{section: condor_transform_ads language} + +Transform rules files consist of lines containing key=value pairs or +transform commands such as =SET=, =RENAME=, etc. Transform commands execute +as they are read and can make use of values set up until that point +using the =$(key)= macro substitution commands that HTCondor configuration files +and condor_submit files use. + +Most constructs that work in these files will also work in rules files such as if/else. Macro substitution will fetch attributes of the ClassAd to be transformed when =$(MY.attr)= is used. + +The transform commands are: + +*: =SET <attr> <expr>= Set =<attr>= to =<expr>= +*: =EVALSET <attr> <expr>= Evaluate =<expr>= and then set =<attr>= to the result +*: =DEFAULT <attr> <expr>= Set =<attr>= to =<expr>= if =<attr>= is undefined or missing +*: =COPY <attr> <newattr>= Copy the value of =<attr>= to =<newattr>= +*: =COPY /<regex>/ <newattrs>= Copy the values of attributes whose names match =<regex>= to =<newattrs>=. +*: =RENAME <attr> <newattr>= Rename =<attr>= to =<newattr>= +*: =RENAME /<regex>/ <newattrs>= Rename attributes matching =<regex>= to =<newattrs>= +*: =DELETE <attr> <newattr>= Delete =<attr>= +*: =DELETE /<regex>/= Delete attributes matching =<regex>= +*: =EVALMACRO <key> <expr>= Evaluate =<expr>= and then insert it as a transform macro value +*: =TRANSFORM [<N>] [<vars>] [in <list> | from <file> | matching <pattern>]= Do the Tranform + +In the above commands =<attr>= must be a valid attribute name and =<expr>= a valid ClassAd +expression or literal. The various $() macros will be expanded in =<expr>=, =<newattr>= or +=<newattrs>= before they are parsed as {quote: ClassAd} expressions or attribute names. + +When a =COPY=,=RENAME= or =DELETE= with =<regex>= is used, regex capture groups are substituted in +=<newattrs>= after $() expansion. \0 will expand to the entire match, \1 to the first capture, etc. + +A =TRANSFORM= command must be the last command in the rules file. It takes the same options as the +=QUEUE= statement from a HTCONDOR submit file. There is an implicit =TRANSFORM 1= at the end of a rules file +that has no explicit =TRANSFORM= command. + + +{subsection: OSGs default route expressed in the TJ's proposed new transform language. } lines starting with the keywords *set*, *delete*, *copy*, *rename*, *name* are commands to the transform engine and are executed as they are read. lines that are of the form key = value set temporary variables that can be referenced in transform commmands using the various $() and $function() macro expansions that are common to config and submit files.