Active IQ Unified Manager Discussions

Escape the unescapeable (illegal escape sequence: F)

ninja
11,980 Views

In WFA i'm trying to display the path to a share so that the person running the workflow can see what the share name will end up being. This share name is generated from other drop downs and fields that are populated. I'm using a sql query to generate a path such as \\somename\blah\blah\Flah. Not the best way of doing it but I see no other option to display to the users what the outcome will be.

 

When i run the workflow i get the expected error "illegal escape sequence: F". I have tried to create function to escape the \ and add a second \ to produce \\F or for any other character that comes before the backslash but it doesn't work because it errors because it doesn't understand the characters which are fed into it. Java escape characters are limited to these \t,\b,\n,\r,\f,\',\",\\ so if the share name contains any of that it will work...anything fails. Because I can't escape other letters after the backslash such as \F \Z \X it produces an error.

 

I know I can just produce the second backslash directly from the sql query but then the share name will look irregularly. (\\\\somename\\blah\\blah\\Flah).

 

Let me know if you have a better idea to try to display the share name.

 

One other things that I might try but not sure will work because the field will still error would be to create a second unopened/hidden field with the share name using the correct syntax and feed that to the command.

 

1 ACCEPTED SOLUTION

cbauernf
11,964 Views

I played around with this a little bit and it seems it is only a problem if the variable begins with a backslash.  I put this in a QUERY type variable:

 

SELECT
    'UNC:\\\\strange\\share\\${yourtexthere}'

 

and it displays as expected:  UNC:\\strange\share\...  with the $yourtexthere user input replacing the ...

 

If you only need this user input for display purposes, that should be fine.  Otherwise it is easy to chop off the leading characters with some MVEL.

 

Christian

View solution in original post

4 REPLIES 4

cbauernf
11,965 Views

I played around with this a little bit and it seems it is only a problem if the variable begins with a backslash.  I put this in a QUERY type variable:

 

SELECT
    'UNC:\\\\strange\\share\\${yourtexthere}'

 

and it displays as expected:  UNC:\\strange\share\...  with the $yourtexthere user input replacing the ...

 

If you only need this user input for display purposes, that should be fine.  Otherwise it is easy to chop off the leading characters with some MVEL.

 

Christian

ninja
11,954 Views

Oddly enough after adding some chars before the \\ and then chopping off the "UNC:" chars for the command input it allows the preview to run green.

 

I further tied to just leave the \\ at the beginning from the select statement and then tried to chop the \\ chars at the command input but that didn't work. I got the same illegal escape sequence. Very odd behavior.

Vinodhini
11,557 Views

Hi,

 

You can enclose the UNC path with double quotes. It works in all the cases irrespective of if the path starts with a double backslash or not.

krishgudd
11,346 Views

Double quotes options works perfectly.

 

I have one query reated to it. I am working in CIFS share setup work flow and part of it i am trying to applying NTF permissions using UNC path.

 

I am using one of the DAR provided by community member and in that workflow we have to mention UNC path to apply the permissions.

 

UNC path referred to as \\vserver FQDN\sharename

 

When i enter manually the UNC path  its working,but how to substitue the variables values in UNC path.

 

When i give \\$vsername\$sharename its not taking the values and throwing errors- Ilegeal expression.

 

I am attaching the DAR file which i dowloaded from the community.

 

 

Public