replace

You can use the replace command to replace the existing scheduling or security item definitions in the database.

Overview

The replace command is similar to add command in some scenarios. When you run the command, if the item definition is in the database, then the definition is replaced by the new one and if not, a new item definition is created in the database. The replace command checks for loop dependencies. For example, if TASK1 follows TASK2 and TASK2 follows TASK1, there is a loop dependency in the workflow.

To replace an existing item, you must have modify access. To add a new item, you must have the add access.

Syntax and command line options

Before you run the command, you must specify the name of the file that contains the item definition. You can run the command as follows:
ocli model replace|rep filename [;unlock] [;password[=key]]
where, filename is the name of the file that contains the item definition.
;unlock
You must use the option, if the existing item that you want to update is locked by other users. To perform this action, you must have the modify and unlock access to the item you want to update.
v2.1.6+;password[=key]
You can use this option to provide the decryption key for files that contain {aes-user}, AES:, or ENCRYPT: encrypted password fields. Orchestration CLI auto-detects the prefix in the file and applies the appropriate decryption method. For files that use only the {aes} prefix, no option is required. The key is resolved in the following order of precedence:
  1. The WA_EXPORT_PWD environment variable.
  2. The key value provided inline with ;password=key.
  3. An interactive prompt, if neither of the above is set.
Important: If you replace an item by changing its key, a new item is created without modifying the existing one.

Example

  1. Run the following command to replace the task definitions from the file goodtask file:
    ocli model replace goodtask
  2. v2.1.6+Run the following command to replace user definitions from the file users_export.txt, decrypting {aes-user} password fields using the key stored in the WA_EXPORT_PWD environment variable:
    export WA_EXPORT_PWD="mySecretKey123"
    ocli model replace users_export.txt