Parsing OCLI files in streaming
HCL Universal Orchestrator enables
you to add
or replace
files containing multiple item types
through OCLI in a single command.
The parsing of the file is done in streaming, meaning that the parser reads the file one line at a time. As a result, the file is not stored during the parsing process, and each item is processed while the file is read.
- Avoid out of memory errors even for large files
- Send a response during parsing process instead of having to wait until the end of the process
- Detecting item type
-
The parser detects the item type in two phases:
- If a dollar sign $ is present at the beginning
of an item definition, the parser assigns the item type following
the dollar sign. Valid values are:
acl
securityrole
jobstream
job
credentials
variables
vartable
workstation
folder
calendar
apikey
- If there is no dollar sign, the parser uses "job stream" as the default item type. When a different item type is detected, the default item type changes to the detected type. In this scenario, if no dollar sign is detected, the item type is taken from the section the item is in.
- If a dollar sign $ is present at the beginning
of an item definition, the parser assigns the item type following
the dollar sign. Valid values are:
- Reference handling
- Items in the file can reference each other. A simple reference example is a
folder and an item defined inside that folder. HCL Universal Orchestrator can
parse items and handle references even if referenced items are not listed in
order. Listing items in order guarantees better performances.Note: To enhance the efficiency of the reference-saving process, the sequence of the items at the conclusion of the process may be different from their order in the file.
- Loop handling
- Loop dependencies
HCL Universal Orchestrator can perform the
add
orreplace
action on job streams with loop dependencies.Consider the following example:JS1
followsJS2
JS2
followsJS3
JS3
followsJS1
An error message appears if a job stream in
add
encounters a loop dependencies related error. In that case, the job stream is added in draft without its dependencies.
- Cache fine-tuning
- It is recommended to have an ordered list of items to maximize performances.
When listing items, put the items that refer to other items after the items they
are referring to.
Items with references that are not found are put in error and saved in a cache. The property
uno.ocli.file.max.errors.cache.size
can be used to set the maximum cache size to prevent it from growing indefinitely. The default maximum cache size is set to 1,000 items.Items in error parsed after the cache is full are processed as regular items with no reference handling.