search cancel

Action ROC - Replace Tokens in Files incorrectly replacing multiple undefined tokens on one line

book

Article ID: 134660

calendar_today

Updated On:

Products

CA Release Automation - Release Operations Center (Nolio) CA Release Automation - DataManagement Server (Nolio)

Issue/Introduction

Please find the problem scenario


Action: ROC - Replace Tokens in Files 

Token File (single line in the file): token_values = @@[email protected]@[email protected]@[email protected]

Action configuration: replaceEmptyValues = true

Tokens defined in Release Operation Center (ROC): @@[email protected]@ with empty value

Environment

Release : 6.4,6.5,6.6

Component : CA RELEASE AUTOMATION ACTION PACK

Cause

Token defined: @@[email protected]@

Token File: @@[email protected]@[email protected]@[email protected]@

Action configuration: replaceEmptyValues=True

Use case: As an end user I want to replace empty token i.e. @@[email protected]@ should be replaced with empty values


The system is not just dependent on parsing of the line to match start and end of @@, instead gets list of tokens defined in system and doing search and replace. The token replacement with parsing @@ will be very slow and inefficient in general.


So in above case when UNDEFINED_TOKEN_1/2 is not defined but it finds @@[email protected]@ so it get replaced. It treats @@ at start and end of line as just as characters.

Resolution

The feature working as per design. In case if you want to not let that happen use replaceEmptyValues=false or split the token entries with spaces explicitly marking start and end of tokens