Topic
  • 4 replies
  • Latest Post - ‏2012-03-20T12:19:03Z by SystemAdmin
SystemAdmin
SystemAdmin
151 Posts

Pinned topic inverse enginerrng from OPL model

‏2012-02-10T12:57:20Z |
Hi,
I´m developing an ODM 3.5 application from an existing OPL model. To create the Data Model, I use inverse enginering from the OPL model. But the data Model is not as I expected:
in the OPL Model there was data with this structure:

{string} data = ...

but in the data model of the OPL model linked to the ODM application the data appears like

tuple TData{
string value;
}
{TData} data =...

In the OPL model I use the data in the first form so many times. I´have the option to make the original data from the new structure : {string} originalData = {t.value|t in data} but I´ll like to make it directly from ODM

is there a way to change it to the original data from ODM?

Thanks in advance,

Lucía
Updated on 2012-03-20T12:19:03Z at 2012-03-20T12:19:03Z by SystemAdmin
  • Michel Eisenmann
    Michel Eisenmann
    15 Posts

    Re: inverse enginerrng from OPL model

    ‏2012-03-06T14:44:17Z  
    Hi Lucia,

    I don't think you can change this from ODME.

    From the ODME point of view, the data model is seen table by table meaning that tables are translated directly into OPL tuples. There is no generation of tuples having only one simple type like what you are asking for.

    So I think you will have to adjust your existing code...

    Hope this helps.
    Regards

    Michel
  • SystemAdmin
    SystemAdmin
    151 Posts

    Re: inverse enginerrng from OPL model

    ‏2012-03-06T16:28:05Z  
    Hi Lucia,

    I don't think you can change this from ODME.

    From the ODME point of view, the data model is seen table by table meaning that tables are translated directly into OPL tuples. There is no generation of tuples having only one simple type like what you are asking for.

    So I think you will have to adjust your existing code...

    Hope this helps.
    Regards

    Michel
    I think changing tuple to singleton tuple or array set may help you.

    Try:
    (under ODME view)

    Open "Decision Process Configuration\<project name>.odmopl"

    (this is where you make table to tuple mappings for input and output)

    In OPL Elements table, you will see your tuple sets which are map to Input / Output etc. Riht click on the one you want to modify, and select "Singleton Tuple Set" option or "Transform to Array" option.

    I haven't tried these myself, but I think this is what you need.
  • Michel Eisenmann
    Michel Eisenmann
    15 Posts

    Re: inverse enginerrng from OPL model

    ‏2012-03-06T17:48:46Z  
    I think changing tuple to singleton tuple or array set may help you.

    Try:
    (under ODME view)

    Open "Decision Process Configuration\<project name>.odmopl"

    (this is where you make table to tuple mappings for input and output)

    In OPL Elements table, you will see your tuple sets which are map to Input / Output etc. Riht click on the one you want to modify, and select "Singleton Tuple Set" option or "Transform to Array" option.

    I haven't tried these myself, but I think this is what you need.
    Hi,

    Seemed like a good idea but I just tried doing this with no success.
    I've an error when I declare the mapping in the IDE when trying to declare the array.
    I think the problem comes from the fact that it is an array you get and the mapping is complaining about missing bounds for the array...

    For info, I double-checked with dev-team and mapping a table to a {string} directly is not possible.

    So back to modifying your code manually.

    Sorry for the bad news.

    Michel
  • SystemAdmin
    SystemAdmin
    151 Posts

    Re: inverse enginerrng from OPL model

    ‏2012-03-20T12:19:03Z  
    Hi,

    Seemed like a good idea but I just tried doing this with no success.
    I've an error when I declare the mapping in the IDE when trying to declare the array.
    I think the problem comes from the fact that it is an array you get and the mapping is complaining about missing bounds for the array...

    For info, I double-checked with dev-team and mapping a table to a {string} directly is not possible.

    So back to modifying your code manually.

    Sorry for the bad news.

    Michel
    Yeah, it is bad news but it has a solution from OPL, so it is not really a problem.

    Thanks both for your time to answer.

    Lucía