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.

Not storing the entire file in memory enables HCL Universal Orchestrator to:
  • 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:
  1. 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
  2. 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.
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 or replace action on job streams with loop dependencies.

Consider the following example:
  • JS1 follows JS2
  • JS2 follows JS3
  • JS3 follows JS1
To manage this situation, the job streams are added in draft without their dependencies. If an error occurs during this process, the item is discarded and the error is reported to the user. When all the job streams are added in draft, dependencies are added and the job streams are saved.

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.

Loop recovery jobs

HCL Universal Orchestrator can perform the add or replace action on jobs with loop recovery options.

Consider the following example:
  • JOB_1 RECOVERY AFTER JOB_2
  • JOB_2 RECOVERY AFTER JOB_3
  • JOB_3 RECOVERY AFTER JOB_1

To manage this situation, the job definitions are added without their recovery options. When all the jobs are added in draft, recovery options are added and the job definitions are saved.

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.