When I put the following code inside a groovy script to provide the “Loop while” value in a standard loop:
import java.util.logging.Logger;
Logger logger = Logger.getLogger(“org.bonitasoft”);
logger.severe(“iterate”);
loopVar++;
if (loopVar > loopEnd) {
return true;
}
else {
return false;
}
I get an exception:
2015-06-05 18:20:25 org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork
SEVERE: THREAD_ID=109 | HOSTNAME=Phillips-MacBook-Air.local | TENANT_ID=1 | The work [ExecuteFlowNodeWork: processInstanceId:11, flowNodeInstanceId: 42] failed. The failure will be handled.
2015-06-05 18:20:25 org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork
SEVERE: THREAD_ID=109 | HOSTNAME=Phillips-MacBook-Air.local | TENANT_ID=1 | org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException : "PROCESS_DEFINITION_ID=7018794897348539495 | PROCESS_NAME=testloop | PROCESS_VERSION=1.0 | PROCESS_INSTANCE_ID=11 | ROOT_PROCESS_INSTANCE_ID=11 | FLOW_NODE_DEFINITION_ID=-7795268830872498336 | FLOW_NODE_INSTANCE_ID=42 | FLOW_NODE_NAME=Step1 | org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Groovy script throws an exception of type class org.bonitasoft.engine.commons.exceptions.SBonitaRuntimeException with message = Unable to evaluate expression without a definitionId
Expression : SExpressionImpl [name=incrementLoop, content=import org.bonitasoft.engine.connector.ConnectorException;
import org.bonitasoft.engine.bpm.process.ProcessDefinition;
import org.bonitasoft.engine.api.ProcessAPI;
import java.util.logging.Logger;
Logger logger = Logger.getLogger(“org.bonitasoft”);
logger.severe(“iterate”);
loopVar++;
if (loopVar > loopEnd) {
return true;
}
else {
return false;
}, returnType=java.lang.Boolean, dependencies=[SExpressionImpl [name=loopVar, content=loopVar, returnType=java.lang.Integer, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_VARIABLE]], SExpressionImpl [name=loopEnd, content=loopEnd, returnType=java.lang.Integer, dependencies=, expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_VARIABLE]]], expressionKind=ExpressionKind [interpreter=GROOVY, type=TYPE_READ_ONLY_SCRIPT]]"
org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException: PROCESS_DEFINITION_ID=7018794897348539495 | PROCESS_NAME=testloop | PROCESS_VERSION=1.0 | PROCESS_INSTANCE_ID=11 | ROOT_PROCESS_INSTANCE_ID=11 | FLOW_NODE_DEFINITION_ID=-7795268830872498336 | FLOW_NODE_INSTANCE_ID=42 | FLOW_NODE_NAME=Step1 | org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Groovy script throws an exception of type class org.bonitasoft.engine.commons.exceptions.SBonitaRuntimeException with message = Unable to evaluate expression without a definitionId
Expression : SExpressionImpl [name=incrementLoop, content=import org.bonitasoft.engine.connector.ConnectorException;
import org.bonitasoft.engine.bpm.process.ProcessDefinition;
import org.bonitasoft.engine.api.ProcessAPI;
import java.util.logging.Logger;
This is version 6.5.1 community, java version “1.8.0_45”, tomcat server that is packaged with 6.5.1 community edition.
Anyone know how to fix this? Thanks in advance,
Phil