-
Notifications
You must be signed in to change notification settings - Fork 0
Home
stevechappell2000 edited this page Jan 1, 2018
·
5 revisions
The CruiseJS plugin runs a Java 8 Nashorn server side script engine. Commands sent to this plugin run on the server and return a JSON response. The Plugin provides access to the Cruise SessionObject and the Cruise Service object.
{
"parameters": {
"name": "CruiseDirector",
"id": "Generated"
},
"services": [
{
"parameters": {
"pluginName": "CruiseDatabase",
"action": "cDBCreatePool",
"service": "CreatePoolService",
"poolName": "MyPool",
"config_DriverClassName": "org.mariadb.jdbc.Driver",
"config_jdbcUrl": "jdbc:mysql://cruisesample.canimgkllxkw.us-west-2.rds.amazonaws.com/CruiseSample",
"config_username": "stevechappell",
"config_password": "Java#1111",
"config_maximumPoolSize": "25",
"config_minimumIdle": "5"
}
},
{
"parameters": {
"pluginName": "CruiseJS",
"action": "RunScript",
"service": "scriptInsert",
"Script": "var ser = cruSession.getService(\"insertCustomers\");
for(var i=0;i<2000;i++){
ser.Parameter('CUSTOMERINDEX','XXXX1:000000000000'+i);
ser.Parameter('FIRSTNAME','FirstName'+i);
ser.Parameter('LASTNAME','LastNameName'+i);
cruSession.goService(ser,true,true);
}"
}
},
{
"parameters": {
"execute": false,
"pluginName": "CruiseDatabase",
"action": "insert",
"service": "insertCustomers",
"poolName": "MyPool",
"tableName": "CUSTOMER"
}
}
],
"credentials": {
"parameters": {
"username": "admin",
"password": "admin"
}
}
}