Page History
...
replaceAll( string: String, regex: String, replacement: String)Anchor function_replaceall function_replaceall - Similar to the Java replaceAll method.
- Use of
$
and\
inreplacement
: If capturing groups from theregex
are used inreplacement
e.g.$1
then$1
will not be a variable but an identifier ofreplaceAll
similar to the Java methodreplace($myString, 'x', '-->$1<--')
.replacement
. Examples:
Expression replaceAll( $js7OrderId, '^#([0-9]{4}-[0-9]{2}-[0-9]{2})#.*$', '$1' )
JSON "replaceAll( $js7OrderId, '^#([0-9]{4}-[0-9]{2}-[0-9]{2})#.*$', '$1')"
Sample Value 2021-06-27
This example extracts the daily plan date from the build-in
$js7OrderId
variable and , for example it will extract the date from an Order ID such as#2021-06-27#
P0000000412-jdScheduleBusinessDays
.
...
JobResource:<JobResource>:<Variable>
- The function returns the value of the specified
<Variable>
from the given<JobResource>
. - Note the shorthand syntax which does not use brackets
Examples:
Expression JobResource:database_uk:db_user
JSON "JobResource:database_uk:db_user"
Sample Value scott
Expression JobResource:database_uk:db_user orElse 'scott'
JSON "JobResource:database_uk:db_user orElse 'scott'"
Sample Value scott
This example reads the
db_user
variable from thedatabase_uk
Job Resource. If the variable does not exist then the default value'scott'
is used.
- The function returns the value of the specified
toFile( string: <Content>, string: <FileSpecification>Anchor function_tofile function_tofile - The function returns the absolute path to a temporary file which holds the value of the specified
<Content>
. This can be a constant string or a variable of type string. - The file path is determined by the Agent using its
JS7_AGENT_DATA/work/values
directory and a temporary sub-directory. - The
<FileSpecification>
. is is used to determine the file extension, for example *.xml. - The function can only be used with JS7 - Job Resources and JS7 - Jobs.
- Typical use cases include a situation when longer values for job resource variables or order variables are used and where these would be truncated when exposed as environment variables in shell jobs. In this situation the variable's value can be written to a temporary file and the job's environment variables receives the path to the temporary file. This can then be processed using, for example, OS commands.
Examples:
Expression toFile( 'some long string value', '*.txt' )
JSON "toFile( 'some long string value', '*.txt' )"
Sample Value /home/sos/agent/var_4445/work/values/0/32.txt
- The function returns the absolute path to a temporary file which holds the value of the specified
...
Overview
Content Tools