I have created an ESP APPL which has file trigger component.
The windows filename appended with directory path is of 160 characters length.
When I try to simulate the ESP APPL it throws an error ESPWSS900I STRING TOO LONG.
It looks like ESP allows only 128 characters in the filename field.
Is there any work around ? as I cannot edit the file path to reduce it to 128 characters..
According to the Command Reference for under "FILENAME Statement":
Limits: Up to 128 characters; case-sensitive
Thanks for the reply.. I do know that limit is 128.. do we have a work around is my question ?
Sorry about that! The only thing that comes to mind would be to use a variable? So, set a variable with your 160 character file name, then use that variable for the path of the file trigger.
FILEPATH = '/super/long/260/plus/character/path/to/the/file/you/want/to/watch.xml'
FILE_TRIGGER MY_FILE_TRIGGER AGENT myagent RUN DAILY FILENAME FILEPATH CREATE RELEASE (MYJOB) ENDJOB
Of course, my syntax my be off, so you may have to "teak" that a little to get it to work.
Thanks Jonathan.. How can I specify the parameter FILEPATH ? I mean where do I specify it ? In which component ?
You can do it at the APPL level. That will give you the option to name your variable whatever you want (I just used FILEPATH as an example). You could set as many as you need at the top of the app, then "plug" them in to your file watcher definitions as you go. So, to expand on this a little:
APPL MYAPP POST OLDEST
FILE1 = '/super/long/260/plus/character/path/to/the/file/you/want/to/watch1.xml'
FILE2 = '/super/long/260/plus/character/path/to/the/file/you/want/to/watch2.xml'
FILE3 = '/super/long/260/plus/character/path/to/the/file/you/want/to/watch3.xml'
FILE4 = '/super/long/260/plus/character/path/to/the/file/you/want/to/watch4.xml'
FILE5 = '/super/long/260/plus/character/path/to/the/file/you/want/to/watch5.xml'
FILE_TRIGGER MY_FILE_TRIGGER_1 AGENT myagent RUN DAILY FILENAME FILE1 CREATE RELEASE (MYJOB1) ENDJOB
FILE_TRIGGER MY_FILE_TRIGGER_2 AGENT myagent RUN DAILY FILENAME FILE2 CREATE RELEASE (MYJOB2) ENDJOB
FILE_TRIGGER MY_FILE_TRIGGER_3 AGENT myagent RUN DAILY FILENAME FILE3 CREATE RELEASE (MYJOB3) ENDJOB
FILE_TRIGGER MY_FILE_TRIGGER_4 AGENT myagent RUN DAILY FILENAME FILE4 CREATE RELEASE (MYJOB4) ENDJOB
FILE_TRIGGER MY_FILE_TRIGGER_5 AGENT myagent RUN DAILY FILENAME FILE5 CREATE RELEASE (MYJOB5) ENDJOB
Legal Disclaimer: Like I said, my syntax may be way off. I suggest you consult DocOps and read up on variables.
I tried your suggestion as below
FILE_TRIGGER MY_FILE_TRIGGER_1 AGENT myagent RUN DAILY FILENAME %FILE1 CREATE RELEASE (MYJOB1) ENDJOB
The file1 is replaced with the actual file name while simulation and it throws the same error.
I guess you could also try to use a symbolic, but it may resolve the same way. You're probably going to have to just live with the limitation.
It would be possible to use an alias for the path. The server admins can set this up. Then it looks like it file is in /opt/abc/ but it is really in the full path...
Just a thought.
I have not tested this, but the Windows MKLINK command may provide a workaround.
MKLINKCreates a symbolic link.
MKLINK [[/D] | [/H] | [/J]] Link Target
/D Creates a directory symbolic link. Default is a file symbolic link. /H Creates a hard link instead of a symbolic link. /J Creates a Directory Junction. Link specifies the new symbolic link name. Target specifies the path (relative or absolute) that the new link refers to.
I have successfully tested using the MKLINK command to create a create a directory symbolic link.
MKLINK Command - /d option for Directorymklink /d LongDir D:\XXXData\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz\abcdefghijklnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz
Create FILE_TRIGGER Job - Drive letter is required or I get SCAN FAILED
FILE_TRIGGER FILETRG AGENT NT_WKSP000550DD FILENAME D:\LongDir\a.a /* Drive is required, a.a is filename */ RUN DAILY RELEASE JOB1 ENDJOB
JOB JOB1 TASK SELFCOMPLETING SEND 'Job1 run! - %ESPFTFILE' USER(*) RUN ANYDAY ENDJOB
I created the file before the Event was triggered so job completed immediately.
Job Name WT ApplName CCode P Node Gen# Job Status FILETRG FM FILETRG 0 COMPLETE 112 File already created JOB1 FILETRG 0 COMPLETE 112 COMPLETED AT 09.51 08 AUG
On Linux use the 'ln -s' command to create a symbolic link to the directory name that exceeds the supported character count.
ln -s <path/to/directory> <symbolic link>
ln -s /home/compops/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz LongDir
FILE_TRIGGER FILETRG AGENT <Linux Agent Name> /* Prefix symbolic link with path of the */ /* directory that it was created in */ FILENAME /home/compops/LongDir/a.a RUN DAILY RELEASE JOB1 ENDJOB JOB JOB1 TASK SELFCOMPLETING SEND 'Job1 run!' USER(*) RUN ANYDAY ENDJOB
Notes - from the Agent transmitter.log file
Windows Agent - sends NAME of Link
Linux Agent - sends VALUE of the Link
Use environment variables. But the major point is this .. the answer is NOT to create a link per se but to allow for a larger field.
SAs etc. may not want links etc.
This is the REAL world many of us work in and there are does and don’ts .. yes a link will help but if you have no access and it takes a change request to get it done then it’s a horrible answer
Just my 3 cents
Nothing in this message is intended to constitute an electronic signature unless a specific statement to the contrary is included in this message.
Confidentiality Note: This message is intended only for the person or entity to which it is addressed. It may contain confidential and/or privileged material. Any review, transmission, dissemination or other use, or taking of any action in reliance upon this message by persons or entities other than the intended recipient is prohibited and may be unlawful. If you received this message in error, please contact the sender and delete it from your computer.
The OP wrote:
Can you provide a working example with an environment variable that will be a workaround until that time when the product no longer has the 128 character restriction?
I have tried using variables at ESP level., and used it within the file trigger. But the file trigger replaces the variable with actual path during simulation.
Would the MKLINK example above work in you environment?While it may not be the best solution, it does provide a workaround until CA removes the 128 character restriction or another workaround is provided.
I've created an idea for this: