SequenceFlow_1yt8rei
SequenceFlow_1yt8rei
SequenceFlow_1b9ke4k
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import com.services.testing.logging.ScriptLogging
Logger log = LoggerFactory.getLogger(ScriptLogging)
def processName = execution.getProcessEngineServices().getRepositoryService().getProcessDefinition(execution.getProcessDefinitionId()).getKey()
log.info("Initializing " + processName + "...")
def result= S('{}')
result.prop("status", "FAILURE")
result.prop("statusMessage", "Flow Failed for Unknown Reason")
result.prop("processId", execution.getProcessInstanceId())
result.prop("processName", processName)
execution.setVariable("result", result)
def allEnvVars = System.getenv();
def computerName = allEnvVars.COMPUTERNAME + "." + allEnvVars.USERDNSDOMAIN;
execution.setVariable("computerName", computerName);
execution.setVariable("responseReceived", false);
execution.setVariable("responseCheckCounter", 0);
execution.setVariable("responseCheckLimit", 50);
//log.info(allEnvVars.toString());
SequenceFlow_136hte6
SequenceFlow_0kcp8fn
SequenceFlow_1yxboju
SequenceFlow_1nzr1lu
SequenceFlow_1j8oyav
SequenceFlow_1cc0to8
execution.removeVariable("processLogObj");
execution.removeVariable("errorCode")
execution.removeVariable("errorMessage")
SequenceFlow_1cc0to8
SequenceFlow_1wiu6gh
SequenceFlow_0ofppmv
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import om.services.testing.logging.ScriptLogging
import org.camunda.bpm.engine.delegate.BpmnError
Logger log = LoggerFactory.getLogger(ScriptLogging)
log.error("Exception Caught: " + errorCode + ": " + errorMessage)
//Set Failure Result
result.prop("status", "FAILURE")
result.prop("statusMessage", errorCode + ": " + errorMessage)
execution.setVariable("result", result)
SequenceFlow_0ofppmv
SequenceFlow_1j8oyav
SequenceFlow_1nzr1lu
SequenceFlow_1wiu6gh
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import om.services.testing.logging.ScriptLogging
import org.camunda.bpm.engine.delegate.BpmnError
Logger log = LoggerFactory.getLogger(ScriptLogging)
def processName = execution.getProcessEngineServices().getRepositoryService().getProcessDefinition(execution.getProcessDefinitionId()).getKey()
log.info("Initializing Global Error Handler: " + processName + "...")
//Initialize the flowResult Object
def result= S('{}')
result.prop("status", "FAILURE");
result.prop("statusMessage", "Flow Failed for Unknown Reason");
result.prop("processId", execution.getProcessInstanceId());
result.prop("processName", processName);
result.prop("responseCode", "999");
execution.setVariable("result", result)
SequenceFlow_1b9ke4k
SequenceFlow_136hte6
import org.camunda.bpm.engine.delegate.BpmnError;
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import com.services.testing.logging.ScriptLogging
Logger log = LoggerFactory.getLogger(ScriptLogging)
log.info("Validating request and setting default values...")
def devID = "NA";
if (!GetShelfPortsRequest) {
log.error("GetShelfPortsRequest is missing")
throw new BpmnError("MissingVariableException", "GetShelfPortsRequest is missing")
}
if (!GetShelfPortsRequest.hasProp("devID")) {
log.info("devID missing")
throw new BpmnError("MissingVariableException", "devID is missing")
}
else {
devID = GetShelfPortsRequest.prop("devID").value()
if(devID== null || devID.isEmpty() || devID.equals("null")) {
log.error("devID is empty or null")
throw new BpmnError("InvalidVariableException", "devID is empty or null")
} else {
execution.setVariable("devID", devID)
}
}
if (!GetShelfPortsRequest.hasProp("returnAllShelves")) {
log.info("returnAllShelves missing")
throw new BpmnError("MissingVariableException", "returnAllShelves is missing")
}
else {
returnAllShelves = GetShelfPortsRequest.prop("returnAllShelves").value()
if(returnAllShelves== null || returnAllShelves.isEmpty() || returnAllShelves.equals("null")) {
log.error("returnAllShelves is empty or null")
throw new BpmnError("InvalidVariableException", "returnAllShelves is empty or null")
} else {
execution.setVariable("returnAllShelves", returnAllShelves)
}
}
SequenceFlow_0ztxr30
SequenceFlow_0p8fqf0
SequenceFlow_0kcp8fn
SequenceFlow_0ztxr30
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import com.services.testing.logging.ScriptLogging
Logger log = LoggerFactory.getLogger(ScriptLogging)
def processName = execution.getProcessEngineServices().getRepositoryService().getProcessDefinition(execution.getProcessDefinitionId()).getKey();
def pid = execution.getProcessInstanceId();
def correlationId = "ProceedPortCheckAvailable" + pid + "|" + computerName;
log.info("Setting correlationId to " + correlationId + "...");
log.info("Setting callBackURL to " + computerName + "...");
execution.setVariable("correlationId" ,correlationId);
execution.setVariable("callBackURL",computerName);
SequenceFlow_1wv0gzb
SequenceFlow_1ryg80f
def msTime = 1000;
def start = new Date().getTime();
for (x = 0; x < 1e7; x++) {
if ((new Date().getTime() - start) > msTime){
break;
}
}
SequenceFlow_1ryg80f
SequenceFlow_0bs0xkb
SequenceFlow_1up1t3y
SequenceFlow_1yxboju
SequenceFlow_1up1t3y
SequenceFlow_0ga90eq
import org.camunda.bpm.engine.delegate.BpmnError;
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import com.att.fastbpm.logging.ScriptLogging
Logger log = LoggerFactory.getLogger(ScriptLogging)
log.info("Now we increment the counter")
def newCountValue = responseCheckCounter;
if(!responseReceived){
log.info("Initial count value: " + newCountValue);
newCountValue = newCountValue + 1;
log.info("Incremented count value: " + newCountValue);
execution.setVariable("responseCheckCounter", newCountValue);
} else {
execution.setVariable("responseCheckCounter", responseCheckLimit);
}
if(newCountValue>=responseCheckLimit){
responseReceived = true;
}
SequenceFlow_0p8fqf0
SequenceFlow_0ga90eq
SequenceFlow_1wv0gzb
import org.camunda.bpm.engine.delegate.BpmnError;
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import com.att.fastbpm.logging.ScriptLogging
Logger log = LoggerFactory.getLogger(ScriptLogging)
if(responseReceived==true){
execution.setVariable("responseCheckCounter", responseCheckLimit);
log.info("Got response from callback")
} else {
log.info("Response not received yet")
}
responseReceived
SequenceFlow_1nmr4v2
SequenceFlow_1nmr4v2
SequenceFlow_0bs0xkb
execution.setVariable("responseReceived", true);
//execution.setVariable("responseCheckCounter", responseCheckLimit);
log.info("I got a signal request")