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]
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.
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