Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Importing Javascript Libraries into OPL Script

    Posted 07/08/15 08:03 PM

    Originally posted by: mathygirl


    Is it possible to use 3rd party javascript from oplscript, and if so can you point me to information on how to do this.

    • We'd like to leverage javascript libraries from oplscript but I haven't been able to figure out how. 
    • I was able to include oplscript files using the procedure 'includeScript', but I get error messages when  I try to include third party javascript libraries.

    Here is an example where I tried to include lodash.js  in cutstock_main.mod.:

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Importing Javascript Libraries into OPL Script

    Posted 07/11/15 11:14 AM

    Hi,

    you get this error because the javascript implementation within OPL is not the same as the one you try to use.

    What you could do:

    a) Use an external java call within OPL to call your program in javascript

    b) Have your external not OPL javascript call the oplrun executable

    c) Have some java code do the link, this java code would both call OPL and your javascript code

    PS:

    do not hesitate to log a wish

    regards 


    #DecisionOptimization
    #OPLusingCPLEXOptimizer