Initializing help system before first use

Using Custom Execution Modes from the Model

Within a model you can call insightgetmode to get the execution mode.

You can use the execution model information in a case statement to determine which branch of code to run. As a minimum you must check for the LOAD and RUN execution modes using the constants INSIGHT_MODE_LOAD and INSIGHT_MODE_RUN respectively.

In the example below there are two custom execution modes:
model mymodel
uses "mminsight" 
uses "mmxprs"

!@insight.execmodes.LOAD_ALL.preferredservice=BACKGROUND_SERVICE 
(!@insight.execmodes.LOAD_ALL.descr=Long running background task to load complete data set from 
external datasource !)
!@insight.execmodes.LOAD_ALL.clearinput=true

!@insight.execmodes.EVALUATE_SEGMENTS.threads=1
!@insight.execmodes.EVALUATE_SEGMENTS.preferredservice=FAST_SERVICE 
(!@insight.execmodes.EVALUATE_SEG MENTS.descr=Quick job to evaluate segments. Does not perform any 
optimization !)

!@mc.flush

forward procedure datainput 
case insightgetmode of
  INSIGHT_MODE_LOAD: do
    datainput 
    exit(0)
  end-do 
  "LOAD_ALL": do
    writeln("load all data from external data source") 
    exit(0)
  end-do 
  "EVALUATE_SEGMENTS": do
    writeln("evaluate segments")
  end-do 
  INSIGHT_MODE_RUN: do
    insightpopulate 
  end-do
else
  datainput 
end-case

! load input data 
procedure datainput
  writeln("loading data") 
end-procedure

! create model constraints
! optimize
! post-process results

end-model

© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.