Automic Workload Automation

 View Only
  • 1.  Regular expression in process

    Posted May 27, 2020 03:17 PM
    Hi All,

    Here is the situation, 
    I want to apply the below regular expression for one of the value in process tab of job. I want to check the value for the variable should matches the regular expression condition. Pls suggest my how can this be achievable.
    [A-Za-z0-9_]*  -- it basically accepts upper case or lower case or number or Underscore


  • 2.  RE: Regular expression in process

    Posted May 27, 2020 04:28 PM
    If this is a user-input string, then I'd suggest using a promptset object with a text field.   Text fields inside of promptset objects can be assigned regular expressions.

    https://docs.automic.com/documentation/webhelp/english/ALL/components/DOCU/12.3/Automic%20Automation%20Guides/help.htm#AWA/Objects/promptsDesigner.htm#link17

    ------------------------------
    Pete Wirfs
    SAIF Corporation
    Salem Oregon USA
    ------------------------------



  • 3.  RE: Regular expression in process

    Posted May 28, 2020 02:10 AM
    HI Pete, Thanks for your valuable solution.
    But Here in my case the input is entered by user in some other interface, I have to verify before I process that for job. So I can't include promptset here. 
    Please help me to achieve this inside job process tab .


  • 4.  RE: Regular expression in process

    Posted May 28, 2020 04:07 AM
    Hi.

    Automic does not support regular expressions in many places. You can back this idea to have that changed:

    https://community.broadcom.com/participate/ideation-home/viewidea?IdeationKey=28fbb11d-ce27-4b41-83b7-8f25570eafed

    If you absolutely need to parse a regular expression in the process tab and use the result in "Automic Script" or an Automic variable, I'd think you could currently only do so by parsing it in "JCL", i.e. the external interpretter. You could do verification or other operations against regular expressions in perl/Python/script language of choice, then channel the result back into Automic, e.g. by using what they call a Backend Variable:

    https://docs.automic.com/documentation/webhelp/english/ARA/12.0/DOCU/12.1/ARA%20Guides/Content/AWA//Objects/varaBACKEND.htm

    I have not used this process or had this requirement myself, so please understand that I can not help out with practical or code examples.

    Hth,


  • 5.  RE: Regular expression in process
    Best Answer

    Posted May 28, 2020 04:39 AM
    Just an idea:
    • Create a static VARA containing following keys:
      • underscore
      • numbers
      • lower case characters
        • you don't need upper case characters in this VARA if you convert your INPUT_STRING to lower case with STR_LC

    • set RESULT=STR_LC(INPUT_STRING)
    • use PREP_PROCESS_VAR and STR_SUB to remove all characters from RESULT
    • If RESULT = ""
    • Then OK
    • Else ERROR
      • in addition you would get all characters not matching a-zA-Z0-9_