User Tools

Site Tools


usingdatabaseserverbeansinscripting

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
usingdatabaseserverbeansinscripting [2021/07/28 15:44] – [Triggered Historical] wikiadminusingdatabaseserverbeansinscripting [2021/10/11 18:48] (current) – wikiadmin
Line 1: Line 1:
 =====Scripting for Database Servers (in MIStudio and TransSECS)===== =====Scripting for Database Servers (in MIStudio and TransSECS)=====
  
-Although there is a lot you can do with just using Database Servers set up in the MIStudio logic and in the Devices of TransSECS and MIStudio, using scripts that reference these beans can be a powerful tool.+Although there is a lot you can do with just using Database Servers set up in the MIStudio logic and in the Devices of TransSECS and MIStudio, using scripts that reference these beans can be a powerful tool. Recipe Management is the most common use case for using TransSECS Devices with databases. If the recipes are stored locally (file based recipes) then you might want to consider the automatic file-based recipe handling of TransSECS (by setting transsecs.recipemanager=1 in the ErgoTechConfiguration.properties of your project deployment). 
  
 These examples assume that you have already set up your database (either local or remote) and have set up the connection in your project using a generic (or specific) DatabaseConnectionManager for your database. In MIStudio you will need to be in LIVE mode (toggle from SIM -> LIVE) to enable the database connection during development. These examples assume that you have already set up your database (either local or remote) and have set up the connection in your project using a generic (or specific) DatabaseConnectionManager for your database. In MIStudio you will need to be in LIVE mode (toggle from SIM -> LIVE) to enable the database connection during development.
Line 30: Line 30:
  
 var LinkedHashMap = Java.type("java.util.LinkedHashMap");  var LinkedHashMap = Java.type("java.util.LinkedHashMap"); 
 +var StringValueObject = Java.type("com.ergotech.vib.valueobjects.StringValueObject");
 +var ValueChangedEvent = Java.type("com.ergotech.vib.valueobjects.ValueChangedEvent");
  
 dataMap=new LinkedHashMap(); dataMap=new LinkedHashMap();
Line 35: Line 37:
 //put the data into the map //put the data into the map
  
-bcs1 = BCS1->getValueObject(); //BCS1 is a BroadcastServer in the logic containing the value we want to store in column "value1" +bcs1 = BCS1->getValueObject(); //BCS1 is a server in the logic containing the value we want to store in column "value1" 
-bcs2 = BCS2->getValueObject(); //BCS2 is a BroadcastServer in the logic containing the value we want to store in column "value2"+bcs2 = BCS2->getValueObject(); //BCS2 is a server in the logic containing the value we want to store in column "value2"
  
-dataMap.put("value1",bcs1); //value1 is the column name for the data in the BroadcastServer called "BCS1" +dataMap.put("value1",bcs1); //value1 is the column name for the data in the server called "BCS1" 
-dataMap.put("value2",bcs2); //value2 is the column name for the data in the BroadcastServer called "BCS2"+dataMap.put("value2",bcs2); //value2 is the column name for the data in the server called "BCS2"
  
  
usingdatabaseserverbeansinscripting.1627501477.txt.gz · Last modified: by wikiadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki