Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
custom_plugins [2017/03/19 02:14]
admin [Create Plugin Java Class]
— (current)
Line 1: Line 1:
-===== Custom Plugins ===== 
-//Custom Plugins// is used to extend //TestOptimal// functionality by implementing a set of MScript functions to be used in MScript.  Your plugin can then be enabled in [[modelnode | Model Property]] to call its MScript methods in the model. 
- 
-==== Create Plugin Java Class ==== 
- 
-In your Java IDE, create a new java class inheriting from com.webmbt.plugin.PluginAncestor.  You will need to add //webmbt.jar// and //plugins.jar// to your IDE class path. 
- 
-Implement the required class methods: 
-    * void close() 
-    * String getPluginID() 
-    * void init(ScxmlNode arg0, String[] arg1) throws Exception 
-    * void start() throws Exception 
-    * String snapScreen(String fileName_p) throws Exception 
-  * annotate the class with @TO_PLUGIN (rel. 4.6) 
-  * place custom plugin initialization logic in either the java methods: 
-    * init() - called prior to trigger //MBT_Start// 
-    * start() - called after trigger //MBT_Start// 
-  * add class methods to be exposed to MScript: 
-    * all MScript methods must be declared as public methods 
-    * all MScript methods must be annotated with //@MSCRIPT_METHOD// 
- 
-==== Compile Plugin ==== 
- 
-Once you have the java class created, compile it and package the .class file into a jar file.  If your plugin java class depends on other java classes, make sure also compile those java classes and package them into the same jar file. 
- 
-==== Deploy Plugin ==== 
-copy your plugin jar file into //lib// folder and restart //TestOptimal// server.  If you have updated your plugin, you will need to re-deploy the plugin jar file and restart //TestOptimal// server in order to make the new plugin jar file effective.