IT Process Automation

  • 1.  Run_Script Operator - "Parameters" string truncated at the space character?

    Posted Apr 21, 2017 04:11 PM

    I have a Run_Script Operator that is passing in a single parameter (Parameter 0). 

     

    The parameter is JSON text, which has been formatted with (extra) escape characters to work with cURL for Windows.  Defined in PAM as follows:

     

    Process.jsonStringWithSpaces = "{\\\"event\\\":{\\\"phrase\\\":\\\"thequickbrownfoxjumpedoverthelazydog\\\",\\\"phraseTwo\\\":\\\"the quick brown fox jumped over the lazy dog\\\"}}";

     

    Debugged in PAM as follows:

    {\"event\":{\"phrase\":\"thequickbrownfoxjumpedoverthelazydog\",\"phraseTwo\":\"the quick brown fox jumped over the lazy dog\"}}

     

    When echoed out at the BAT file level:

    echo %~1

     

    I only see the following text:

    {"event":{"phrase":"thequickbrownfoxjumpedoverthelazydog","phraseTwo":"the

     

    So, two (2) things happened on the way from PAM to BAT:

    1. lost all of the slash characters (\)
    2. everything after the space ( ) got truncated

     

    Can anyone tell me how to overcome these limitations when passing a string from PAM to a Windows BAT file?

     

    [Note: Process Automation 4.3.100 SP01]



  • 2.  Re: Run_Script Operator - "Parameters" string truncated at the space character?

    Broadcom Employee
    Posted Apr 28, 2017 10:31 AM

    Hi Fred,

     

    I've had some luck with enclosing text with cdata tags (<![CDATA[]]>) to force characters to remain as they are instead of interpreted as xml markup.  That might help here.



  • 3.  Re: Run_Script Operator - "Parameters" string truncated at the space character?

    Posted Apr 29, 2017 11:09 AM

    It's not being truncated; the %~1 parameter reference stops at the space. Try:

    echo %~1 %~2 %~3 %~4 %~5 %~6 %~7