Creating a Job

The specific details of a Job are provided by creating and populating a RunInfo object. The RunInfo object is found in the package com.engineous.sdk.runtime.

The first thing you do in your application is to make the call to log on. For more information, see Logging On.

RunInfo runInfo = new RunInfo("my job", true);

The true argument specifies that the job results will be stored in the database. It is an optional argument and its default value is true.

You must set the model to be executed in the RunInfo object. If you are executing a model from a file, you must provide the DtModelManager for the model to the RunInfo:

InputStream inputStream = new
FileInputStream("c:\\temp\\MyModel.zmf");
DtModelManager modelMgr = 
DtModelManager.createModel(inputStream);
runInfo.setModel(modelMgr);

If you are executing a model from the Library, you can specify the fully qualified name of the published model and the version of the model you want to execute:

runInfo.setModelName("samples.MyModel");

By default, this step will run the latest published version of the model (Version.LATEST). You can specify to run a different version by calling

runInfo.setModelVer(Version.create("2"));

There are a number of other options you can configure on the RunInfo object, including the job input list (list of values to set at the root level), log level, the model directory (for substitution in file parameters, etc.), the random seed value, and the permissions for whom can view the job (when submitted to a SIMULIA Execution Engine). Review the javadocs for the RunInfo class for more information in the configuration options.