embed-server --server-config=standalone.xml try module add --name=com.mysql --resources=drivers/mysql-connector-java.jar --dependencies=javax.api,javax.transaction.api catch echo "MySQL module exists" end-try if (outcome != success) of /subsystem=datasources/jdbc-driver=mysql:read-resource /subsystem=datasources/jdbc-driver=mysql:add(driver-name=mysql,driver-module-name=com.mysql,driver-xa-datasource-class-name=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource) end-if if (outcome == success) of /subsystem=datasources/xa-data-source=jBPMXADS:read-resource /subsystem=datasources/xa-data-source=jBPMXADS:remove end-if xa-data-source add --name=jBPMXADS --jndi-name="java:jboss/datasources/jBPMDS" --driver-name=mysql --user-name=jbpm --password=jbpm --xa-datasource-class=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource --xa-datasource-properties=[ServerName=localhost, PortNumber=3306, DatabaseName=jbpm] --background-validation=true --background-validation-millis=120000 --exception-sorter-class-name=org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter --valid-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker --validate-on-match=true if (outcome != success) of /system-property=org.kie.server.persistence.ds:read-resource /system-property=org.kie.server.persistence.ds:add(value="java:jboss/datasources/jBPMDS") else /system-property=org.kie.server.persistence.ds:write-attribute(name=value,value="java:jboss/datasources/jBPMDS") end-if if (outcome != success) of /system-property=org.kie.server.persistence.dialect:read-resource /system-property=org.kie.server.persistence.dialect:add(value="org.hibernate.dialect.MySQL5Dialect") else /system-property=org.kie.server.persistence.dialect:write-attribute(name=value,value="org.hibernate.dialect.MySQL5Dialect") end-if if (outcome != success) of /system-property=org.kie.server.id:read-resource /system-property=org.kie.server.id:add(value="sample-server") else /system-property=org.kie.server.id:write-attribute(name=value,value="sample-server") end-if if (outcome != success) of /system-property=org.kie.server.controller:read-resource /system-property=org.kie.server.controller:add(value="http://localhost:8080/business-central/rest/controller") else /system-property=org.kie.server.controller:write-attribute(name=value,value="http://localhost:8080/business-central/rest/controller") end-if if (outcome != success) of /system-property=org.kie.server.location:read-resource /system-property=org.kie.server.location:add(value="http://localhost:8080/kie-server/services/rest/server") else /system-property=org.kie.server.location:write-attribute(name=value,value="http://localhost:8080/kie-server/services/rest/server") end-if if (outcome != success) of /system-property=org.jbpm.casemgmt.showcase.url:read-resource /system-property=org.jbpm.casemgmt.showcase.url:add(value="/jbpm-casemgmt") else /system-property=org.jbpm.casemgmt.showcase.url:write-attribute(name=value,value="/jbpm-casemgmt") end-if stop-embedded-server