importexportCLI attempts to import existing Dynamic Property of a Workflow causing it to fail with ‘Property name in use’ errors

Document ID : KB000084740
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
Affects Release version(s): 6;7;8

Error Message :
Error: Property name is in use.

When using the ImportExportCLI command the above error message may be displayed.  The reason is that deleting a dynamic property of a Workflow does not delete its overriding values in its executions.  Therefore, creating the same property on the workflow leads to the above error.

The same behavior can be seen for other overriding relationships such as when a Deployment Package overrides the dynamic properties of its Component.

Investigation

  1. Create a General Workflow
  2. Define property /tag1, prompt at Execution with a default value "tag1"
  3. Execute the Workflow. overidding /tag1 with value "tag1_execution1"
  4. Export dynamic properties where system_on_entity.system_id = {workflow_id}. Dynamic property Value /tag1 = "tag1".
  5. Delete /tag1 (via ImportExportCLI)
  6. Import /tag1 back into the same system
  7. Receive "Error: Property name is in use."
Actual
When /tag1 is deleted: only the value in the Workflow is deleted.  The value in the Execution is preserved together with the definition of the Property /tag1, so there are 2 vaules in the DynPropVal table.
  • The first value is contained in the Workflow (tag1)
  • The second value is contained in the Execution (tag1_execution1)

Expected
The ImportExportCLI command should behave the same as it does when the same operation is performed from the User Interface, which is:

  1. When deleting a dynamic property value of type Prompt, delete the overriding values as well. 
Example: An executing overrides /tag1 of a Workflow.  Deleting /tag1 value of the Workflow also deletes the overriding values of /tag1 in the Execution.
  1. When deleing an overriding value, cancel overriding which will leave the original property value.
Example: A deployment package overrides /tag1 of a Component.  Deleting /tag1 value of the Package means cancel the override.
  1. Restrict deletion of an overriding value of an Execution.

Example: An execution override /tag1 of a Workflow.  Deleting /tag1 value of the Execution is not allowed.

Environment:
OS: Windows Server 2012
Cause:
Cause type:
Defect
Root Cause: ImportExportCLI - Cannot re-import a dynamic property of Workflow because it had an overriding value on its Execution
Resolution:
Update to a fix version listed below or a newer version if available.

Fix Status: Released

Fix Version(s):
Release Manager 8.0.0 – Available
Release Manager 7.0.2 – Available
Application Release Automation 6.0.4 – Available
Additional Information:
Workaround :
Delete the remaining dynamic property values contained in the Execution. These are the prompt values which the user provides upon Execution.
  1. Export all dynamic property vales of the Workflow and its executions.  Assume the Workflow name is "Create EBX Test".
ImportExportCLI.exe export -format CSV -mt DynamicProperty -where "system_on_entity.system_name eq 'Create EBX Test'" -properties "system_full_name, system_id, system_on_maintype, system_value"

You will see a list of property values similar to this, where one value of /tag1 is contained by the Workflow and the other values are contained by its three executions. system_identity_properties,system_id,system_full_name,system_on_maintype,system_value

system_full_name#;#system_on_maintype,18880,/agent_assignment/agent,Workflow system_full_name#;#system_on_maintype,18881,/agent_assignment/login,Workflow system_full_name#;#system_on_maintype,19000,/tag1,Workflow,tag1 system_full_name#;#system_on_maintype,19111,/tag1,Execution,tag1_execution1 system_full_name#;#system_on_maintype,19222,/tag1,Execution,tag1_execution2 system_full_name#;#system_on_maintype,19333,/tag1,Execution,tag1_execution3

  1. Extract all the id's into "delete.csv".  For example, system_identity_properties,system_id 
 
system_id,18880 system_id,18881 system_id,19000 system_id,19111 system_id,19222 system_id,19333
  1. Delete all the referenced id's using the id number.
ImportExportCLI.exe delete -format CSV -mt DynamicProperty -fi "delete.csv" ​
  1. Now perform the import and you will not receive the error and all the original properties will be restored.