package org.openecomp.mso.bpmn.core;
-import java.util.Objects;
-
-import org.camunda.bpm.engine.ProcessEngineException;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.Expression;
import org.camunda.bpm.engine.delegate.JavaDelegate;
/**
* Base class for service tasks.
*/
-public abstract class BaseTask implements JavaDelegate {
+public class BaseTask implements JavaDelegate {
/**
* Get the value of a required field. This method throws
protected String getOptionalStringField(Expression expression,
DelegateExecution execution, String fieldName) {
Object o = getFieldImpl(expression, execution, fieldName, true);
- return Objects.toString(o, null);
+ if (o instanceof String) {
+ return (String) o;
+ } else if (o == null) {
+ return null;
+ } else {
+ return o.toString();
+ }
}
/**
return getClass().getSimpleName();
}
-
- /**
- * Check if shouldFail variable is set to true.
- * @param execution
- * @return
- */
- protected boolean shouldFail(DelegateExecution execution) {
- Boolean shouldFail = (Boolean) execution.getVariable("shouldFail");
- return shouldFail != null && shouldFail;
- }
+ @Override
+ public void execute(DelegateExecution execution) throws Exception { }
}