Details
-
Feature
-
Status: Released (View Workflow)
-
Minor
-
Resolution: Fixed
-
2.0.0
-
None
Description
Current Situation
- JS7 supports variable substitution using the syntax:
$variable_name ${variable_name}- These variables can be used as placeholders during job configuration and are resolved by the JS7 engine at runtime.
- Job API provides a Resolver interface to post-process (after JS7 engine execution) argument values and set resolved results.
- See: https://change.sos-berlin.com/browse/JITL-742
- Currently, it is not possible to reference newly resolved values within the configuration of other arguments.
Desired Behaviour
- Introduce a Job API specific placeholder syntax:
%{argument_name} - This allows JobArguments to reference other JobArguments within the same configuration map.
- Example:
uri = enc:<some value> request = {"endpoint": "%{uri}"}- After resolution:
request = {"endpoint": "<decrypted uri>"}
- After resolution:
- Example:
Maintainer Note
- Supported features:
- Multiple usage: the same reference can be used multiple times within the same or different argument values.
b = %{a}_some_value_%{a} - Nested references: a reference can point to another reference, forming chains until a final concrete value is resolved.
a = %{b} b = %{c} c = js7- Result:
a = js7
- Result:
- Multiple usage: the same reference can be used multiple times within the same or different argument values.
- The resolver throws a JobArgumentException in the following cases:
- Cyclic reference: arguments reference each other in a loop, e.g.
a = %{b} b = %{a} - Self reference: an argument references itself directly, e.g.
a = %{a} - Unknown reference: a referenced argument does not exist
- Cyclic reference: arguments reference each other in a loop, e.g.