Thus, the first thing you must do in your application, whether you are building/editing a model or executing it, is make the call to log on. To make the call to logon, use the Logon class provided in the com.engineous.sdk.server package. If your program will be run only in standalone (without a SIMULIA Execution Engine), use the following call: Logon.initStandalone(); If you are connecting to a SIMULIA Execution Engine, you must make a more general call that will prompt for a password. This prompt can displayed in a GUI or in the console in which you are running your application by setting a System property that will be used internally by the Logon class (by default, it will use a GUI): System.setProperty(Logon.PROP_PROMPTMODE, "CONSOLE"); Logon.initLogon(JFrame parentFrame, String applicationName); The parentFrame and applicationName are typically used when you have a higher level GUI controlling the interaction with Isight; otherwise, both can be left null. If desired or necessary, you can develop your application in a way that will not prompt for a password when connecting to a SIMULIA Execution Engine but instead will accept the required information as arguments when starting the application. Your application can then use those arguments to set System properties that will be used internally by the Logon class. if (args.length > 1) { // Name of CPR file is given System.setProperty("fiper.logon.profile", args[1]); } if (args.length > 2) { // User id and pw are given System.setProperty("fiper.logon.prop.user", args[2]); System.setProperty("fiper.logon.prop.pw", args[3]); System.setProperty("fiper.logon.prompt", "no"); } try { Logon.initLogon(null); } catch (LogonFailedException lfe) { System.out.println("Logon failed:"); lfe.printStackTrace(System.out); System.exit(2); } Once you have performed the logon, you will have access to all the components and datatypes from the library for building models and can submit jobs to be executed. |