ESP Workload Automation

 View Only
Expand all | Collapse all
  • 1.  File Trigger

    Posted Aug 02, 2017 11:41 AM

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



  • 2.  Re: File Trigger

    Posted Aug 02, 2017 12:54 PM

    According to the Command Reference for under "FILENAME Statement":

     

    Limits: Up to 128 characters; case-sensitive

     

    <JC>



  • 3.  Re: File Trigger

    Posted Aug 02, 2017 01:58 PM

    Thanks for the reply.. I do know that limit is 128.. do we have a work around is my question ?



  • 4.  Re: File Trigger

    Posted Aug 02, 2017 02:31 PM

    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.



  • 5.  Re: File Trigger

    Posted Aug 02, 2017 02:35 PM

    Thanks Jonathan.. How can I specify the parameter FILEPATH ? I mean where do I specify it ? In which component ?



  • 6.  Re: File Trigger
    Best Answer

    Posted Aug 02, 2017 02:57 PM

    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 

     

    JOB_MYJOB1

       RUN DAILY

    ENDJOB

     

    (RINSE, REPEAT)

     

    Legal Disclaimer: Like I said, my syntax may be way off.  I suggest you consult DocOps and read up on variables.

     

    -Jonathan



  • 7.  Re: File Trigger

    Posted Aug 02, 2017 03:24 PM

    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.



  • 8.  Re: File Trigger

    Posted Aug 03, 2017 10:20 AM

    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.



  • 9.  Re: File Trigger

    Posted Aug 03, 2017 11:08 AM

    Hi,

    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. 



  • 10.  Re: File Trigger

    Posted Aug 07, 2017 10:21 AM

    I have not tested this, but the Windows MKLINK command may provide a workaround.

     

    MKLINK
    Creates 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.



  • 11.  Re: File Trigger

    Posted Aug 08, 2017 09:54 AM

    I have successfully tested using the MKLINK command to create a create a directory symbolic link.

     

    Create Directory

    D:\UPSData\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz\abcdefghijklnopqrstuvwxyz\abcdefghijklmnopqrstuvwxyz

     

    MKLINK Command - /d option for Directory
    mklink  /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



  • 12.  Re: File Trigger

    Posted Aug 08, 2017 11:55 AM

    Linux Solution

    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

    Filename("D:\LongDir\a.a")

     

    Linux Agent - sends VALUE of the Link

    Filename("/home/compops/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/abcdefghijklmnopqrstuvwxyz/a.a")



  • 13.  Re: File Trigger

    Posted Aug 08, 2017 12:09 PM

    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

     

     

    Steve C.

     

     

    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.



  • 14.  Re: File Trigger

    Posted Aug 08, 2017 12:42 PM

    The OP wrote:

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

     

    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?



  • 15.  Re: File Trigger

    Posted Aug 09, 2017 11:10 AM

    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.



  • 16.  Re: File Trigger

    Posted Aug 09, 2017 11:35 AM

    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.



  • 17.  Re: File Trigger