Clarity

  • 1.  XOG/GEL Script define manageable Blocks

    Posted Mar 13, 2018 11:38 AM

    Hi All,

     

    This might be a stupid question. But I could really use some help.

     

    Background:

    I am trying to modify a script that runs on one object with around 100 attributes. The code basically looks at different values of the attributes and calculates KPIs based on certain conditions.

    The code is more than 5000 lines long, I am breaking it into two 2500 XOG scripts to improve readability and future maintenance, but don't want to break down further, as they are working on the same set of attributes and doesn't seem logically to do so.

     

    Problem:

    So, enough about the background, need advice on how to break the code into multiple blocks . But what I am looking for is that if I break 30 lines lines into a blocks, it should be collapsible in Notepad++, so that I can focus on next lines of code, and it should be ignored by the process engine while running the script.

     

    For example, if I would have to do this in C# or Java, could simply do it using two single line comments, but as far as I could find this doesn't work in XML:

    //{

     

    //}

    This would define an imaginary block for you to collapse and get it out of the way so that you can move to focus on another block, Just makes the code easier to maintain and clean to read.

     

    Any help is appreciated!

    gcubed



  • 2.  Re: XOG/GEL Script define manageable Blocks
    Best Answer

    Posted Mar 13, 2018 12:15 PM

    You could use an xml comments

    <!--

     

    -->

    The other option would be to wrap them in <core:mute> block of code </core:mute> which would allow to the collapsible in Notepad++ and not have to be removed to run the code.

     

    V/r,

    Gene



  • 3.  Re: XOG/GEL Script define manageable Blocks

    Posted Mar 13, 2018 12:46 PM

    Thanks a lot Gene!

    #youareawesome



  • 4.  Re: XOG/GEL Script define manageable Blocks

    Posted Mar 13, 2018 03:29 PM

    If you have an on premise instance, I would consider developing a java class to do the calcs -- 5000 lines is a lot of jelly!

     

    Another option would be to package up any common logic into custom tag lib.

     

    Just thoughts,

    Gene



  • 5.  Re: XOG/GEL Script define manageable Blocks

    Posted Mar 13, 2018 04:05 PM

    I am on-Cloud, so that’s not an option for this! Is there any other way?

     

    Thanks.

     

    Regards,

     

    Sagar Sarkar

    Business Analyst

    Supply Chain IT

    Cummins Inc.

    Ping on Skype<sip:mj542@cummins.com>.

    In case of Emergency: (352)871-4854 (M)