You can execute an Engine engine from within the model calculation logic. The binding variable model
provides access to the ModelFormulaCalculationContext API which allows you to call the engine – i.e. start a Job Trigger Calculation.
...
In order to run a given engine/image on your partition, you must make a request to Pricefx Support to enable the specific image you want to use, along with the number of CPUs and available RAM you require ( decent starting values are described in engines reference pages)need to have the image enabled on your partition, with a sufficient number of CPUs and enough memory. The most convenient way to request a new engine is via PlatformManager where you can specify the engine type and requested parameters.
This step is not needed for some of the accelerators because they already automatically configure job trigger. Still, the process in PlatformManager can be handy if you need to e.g. increase the allocated resources.
In case of issues or special requests, contact Pricefx Support.
Running a Job Trigger Calculation
...
A model Step executing the calculation , that starts a new Job Trigger Calculation , will be considered as finished only when calculations, formula and Job Trigger are all finished. In terms of execution order, this follows the same rules as sequence calculations.
...
Code Block | ||
---|---|---|
| ||
model.startJobTriggerCalculation(
"cregistry.pricefx.eu/engineering/pricefx-optimization-engine", // name of the engine image
"latest", // tag of the engine image
api.jsonEncode([
// parameters required by the engine image
]),
"oe" // a name for the job, unique for this calculation and step
) |
Parameters Size Limitation
Due to the way parameters
are passed to the engine, its size is limited by maximum length of the environment variable in the OS. Job Trigger won't accept parameters longer than 131000 bytes
by default, and will throw an exception. To pass large amount of data into calculation, store it in a table and fetch them in a script. (see: ARG_MAX limit)
Calculation Process Sequence
...