Finance Automation Base REL Functions
The following base REL functions are used in all flavors. The functions reside in the Redwood_FCA
library.
You call these functions by specifying =<partition>.Redwood_FCA.<function>
.
The examples on this page assume the definition which calls these functions resides in the same partition as the library, specified as $
.
The default partition of the library is FCA
. The REL functions can be accessed via RedwoodScript from the
com.redwood.scheduler.custom.fl.base.rel.FlBaseRel
class.
convertAbsoluteFileReference
Converts the input string containing a relative file reference into an absolute reference.
<jobId>
- id of the current process.<ref>
- JobFile reference with syntax<process>:<file>
.<process>
can be one of the following:<step>, Job <n>
<step>
- the name of a step.<n>
- display order of the process in the step.
parent
- the parent of the current process.Job <id>
- the process with JobId<id>
. Note that this is the expression the function will return.<file>
- the short name of the file, for example,stdout.log
orstep1_spool1.txt
Syntax
Redwood_FCA.convertAbsoluteFileReference(Long jobId, String ref)
Example
=$.Redwood_FCA.convertAbsoluteFileReference(jobId, 'My Special Step, job 1:step1_spool1.txt')
Result
Returns Job 12345:step1_spool1.txt
on this system.
convertList
Provides the option to convert the content of a list into a new list. It calls the Rule ConvertResultList.
note
The REL function automatically identifies a select-option range and handles it accordingly.
The <conversions>
parameter takes a semi-colon-delimited list of commands.Supported commands:
ADD=<int>
- Add an integer to the resulting entries (if numeric).MAX[[=<int>[[,<int>]]
- Return only the highest result. Field specified are key fields.SUM[[=<int>[[,<int>]]
- Return only the sum result. Field specified are key fields.NUMC=<int>
- Convert entries to NUMC format of specified length (if numeric); must be specified after any mathematical commands such asADD
,MAX
, andSUM
.PRE=<String>
- Add string in front of each entry (example PRE=! to exclude in selection).POS=<String>
- Add string to each entry.SUBTRACT=<int>
- Subtract an integer from the entries.DUPLICATES
- Removes duplicate entries from Result List.SELOPT
- Adds Select-Option brackets to result.FIELD=<int>
- Set field in result set to work on (default 1).FIELDS=<int>[[,<int>]
- Reduces the fields in the records to the ones specified.BEFORE=<String>
- Splits the value and uses the first part.AFTER=<String>
- Splits the value and uses the last part.
Syntax
Redwood_FCA.convertList(Long jobId, String inList, String conversions)
Example
=$.Redwood_FCA.convertList(jobId,parameters.IN,'MAX;ADD=1;NUMC=10')
Result
In this example, the value in parameter In
is 97,98,99,100
, so the result returned is:
0000000101
documentExists
Pre-Condition function that returns true if a specified document exists.
Syntax
Redwood_FCA.documentExists(Long jobId, String inDocIds)
Example
=$.Redwood_FCA.outputExists(jobId, $.Redwood_FCA.getDocumentPath(jobId, 'FCA_ACKNOWLEDGEMENTS'))
Result
Returns true
on this system.
getApplCustomizing
Retrieves the value of an Application Customizing key.
Syntax
Redwood_FCA.getApplCustomizing(Long jobId, String key)
Example
=$.Redwood_FCA.getAppleCustomizing(jobId, 'my special key')
Result
Returns my special value
on this system.
getBaseReplacement
Converts the input string using the Base Replacement definitions.
Syntax
Redwood_FCA.getBaseReplacement(Long jobId, String repl)
Example
=$.Redwood_FCA.getBaseReplacement(jobId, '${J:SAP_USER_NAME}')
Result
Returns JDOE
on this system.
getCurrentUser
Syntax
Redwood_FCA.getCurrentUser(Long jobId)
Example
=$.Redwood_FCA.getCurrentUser(chainJobId)
Result
Returns jdoe
on this system.
getDocumentPath
Returns the full path to a document using just the name of the document. It defaults to the partition where application was imported and checks applications in the following order:
- data application, defaults to CUS_FCA_Data
- custom application, defaults to CUS_FCA
- FCA application
Syntax
Redwood_FCA.getDocumentPath(Long jobId, String in)
Example
=$.Redwood_FCA.getDocumentPath(jobId, 'FCA_ACKNOWLEDGEMENTS')
Result
Returns doc:FCA:/FCA.FCA/FCA_ACKNOWLEDGEMENTS.html
on this system.
getFileDir
Returns the parent directory of the provided path.
Syntax
Redwood_FCA.getFileDir(String in)
Example
=$.Redwood_FCA.getFileDir('/etc/hosts')
Result
Returns /etc
on this system.
getFileName
Returns the filename of the provided path.
Syntax
Redwood_FCA.getFileName(String in)
Example
=$.Redwood_FCA.getFileName('/etc/hosts')
Result
Returns hosts
on this system.
getFileParameterJobFile
Retrieve a Jobfile Name from a parameter of type File
.
Syntax
Redwood_FCA.getFileParameterJobFile(Long jobId, String parameterName)
Example
=$.Redwood_FCA.getFileParameterJobFile(jobId, 'Parameter2')
Result
Returns report.html
on this system.
getInboxIconURL
Returns the icon URL or document link for the inbox toolbar button, which can change over time as new messages are received in the inbox and again when read.
Syntax
Redwood_FCA.getInboxIconURL(String aPartitionName)
Example
=$.Redwood_FCA.getInboxIconURL('$')
Result
Returns resource/EPExternalResources/images/ToolbarIconNew.png
on this system.
getJobFilePath
Returns the internal representation of a process.
Syntax
Redwood_FCA.getJobFilePath(Long jobId, String relJobFile)
Example
=$.Redwood_FCA.getJobFilePath(jobId, 'My Special Step, job 1:step1_spool1.txt')
Result
Returns JobFile:123:step1_spool1.txt
on this system.
getParameter
Returns value of a parameter even if it has bad naming (like SAP parameters can have). The Boolean allows a search upwards.
Syntax
Redwood_FCA.getParameter(Long jobId, String inParameter, boolean parents)
Example
=$.Redwood_FCA.getParameter(parentJobId, 'Parameter9', 'true')
Result
The value of parameter Parameter9
of the parent process was set to 1,2,3,4,5
.
1,2,3,4,5
getResultListSize
Returns the size of a result list. The result list is referenced using a relative job specification and a parameter name.
Syntax
Redwood_FCA.getResultListSize(Long jobId, String relJob, String parm)
Example
=$.Redwood_FCA.getResultListSize(jobId,'My Step 1, Job 2', 'Parameter9')
Result
The value of parameter Parameter9
of the parent process
was set to 1,2,3,4,5
. The function returns 4
.
getReturnCode
Returns the return code of a relative job.
Syntax
Redwood_FCA.getReturnCode(Long jobId, String inRelJob)
Example
=$.Redwood_FCA.getReturnCode(chainJobId,'My Step, Job 1')
Result
Returns 0
on this system.
getTaskListIdDescrPairs
Returns the task list in an LOV to be used in a parameter Simple Constraint expression; partition defaults to FCA or GLOBAL if application FCA does not exist.
Syntax
Redwood_FCA.getTaskListIdDescrPairs(String partitionName)
Example
=$.Redwood_FCA.getTaskListIdDescrPairs('$')
Result
Returns =no tasklist found
on this system.
leftFill
The function returns a specified number of characters from the right side of a string.
Syntax
Redwood_FCA.leftFill(String in, int length)
Example
=$.Redwood_FCA.leftFill('Hello World',8)
Result
Returns lo World
on this system.
mergeResultList
Appends one list to another, inserting a comma (,
) when the input list is comma-separated,
and a pipe (|
), when the list is semi-colon-separated.
Syntax
Redwood_FCA.mergeResultList(String in1, String in2)
Example
=$.Redwood_FCA.mergeResultList(parameters.Parameter1,parameters.Parameter2)
Result
Parameters Parameter1 and Parameter2 contain 1,2,3,4
and 5,6,7,8,9,10
, respectively;
the returned value is 1,2,3,4,5,6,7,8,9,10
.
Parameters Parameter1 and Parameter2 contain 1;2;3;4
and 5;6;7;8;9;10
, respectively;
the returned value is 1;2;3;4|5;6;7;8;9;10
.
Parameters Parameter1 and Parameter2 contain Hello World
and 5;6;7;8;9;10
, respectively;
the returned value is 5;6;7;8;9;10|Hello World
.
numericFill
Converts the input string into a SAP NUMC field format (pre-filled with 0).
Syntax
Redwood_FCA.numericFill(String in, int len)
Example
=$.Redwood_FCA.numericFill('123',8)
Result
Returns 00000123
on this system.
outputExists
Pre-Condition function that returns true if a specified output exists. If the file name is not specified, it defaults to the sap standard output.
Syntax
Redwood_FCA.outputExists(String inJobIds, String inFile)
Example
=$.Redwood_FCA.outputExists(jobId, 'step1_spool1.txt')
Result
Returns true
on this system.
removeBkType
Remove the ''type'' prefix in the business key; this is used to sanitize the input string in queries, for example.
Syntax
Redwood_FCA.removeBkType(String in)
Example
=$.Redwood_FCA.removeBkType('JobDefinition:System_Sleep')
Result
Returns System_Sleep
on this system.
rightFill
The function returns a specified number of characters from the left side of a string.
Syntax
Redwood_FCA.rightFill(String in, int length)
Example
=$.Redwood_FCA.rightFill('Hello World',8)
Result
Returns Hello Wo
on this system.
searchParameter
Returns value of a chain parameter, searching for it recursively, beginning from the parent job. The first found wins. Note that it only searches for its direct ancestors, for example, its grand parent and parent processes.
Syntax
Redwood_FCA.searchParameter(Long jobId, String in)
Example
=$.Redwood_FCA.searchParameter(chainJobId, 'Parameter9')
Result
Returns 1,2,3,4,5
on this system.
financeTopic