CA Service Management

  • 1.  How to execute Spel code from a variable

    Posted Aug 17, 2017 11:22 PM

    From within some spel code run by a trigger I would like to be able to determine which future Attached Service Type Events on an Incident/Request ticket are likely to apply (e.g. are for the appropriate status). To do this in a flexible manner I need to be able to evaluate the spel code in the Site-Defined Condition Macros linked to the events, is there a way to do this? So I really need to be able to execute some spel code that is stored in a variable and get the value that it calculated. Is some languages this is termed "Dynamic code execution".

     

    Is this possible in spel?

     

     

    Thanks in anticipation,

     

    Alan



  • 2.  Re: How to execute Spel code from a variable

    Posted Aug 18, 2017 08:24 AM

    Hi Alan,

    This type of thing would require quite a bit of custom code which would be outside of our scope from a support standopint.  However, there may be folks out here on the community who have gotten this type of thing to work, and they might be willing to share their info with you.   Anyone have any ideas for Alan on this?

    Thanks,

    Jon I.



  • 3.  Re: How to execute Spel code from a variable
    Best Answer

    Posted Aug 18, 2017 09:06 AM


  • 4.  Re: How to execute Spel code from a variable

    Broadcom Employee
    Posted Aug 18, 2017 03:21 PM

    Alan, I just throw an idea here(not tested yet but I think it has a chance to work)...

    Create a dummy side defined condition. you will see "macro code" of this dummy condition. Now you have your spel

    code ready(like in a txt file) and then you do pdm_extract to extract this dummy condition and output into a txt file. now

    you edit this output file replacing the "macro code" by your manually written spel code. And then pdm_load it back so

    to have your spel code "inserted" into this dummy condition and then you use this dummy condition as any other side

    defined condition. The whole point is, you can insert your spel code and your spel code would run what ever you want

    it to run, not limit to the configurable simple spel code. I like this idea(lol). Thanks _Chi