1710 Rebase - Second Attempt
[so.git] / bpmn / MSOCoreBPMN / src / main / java / org / openecomp / mso / bpmn / core / BaseTask.java
index 5b43c3f..dea2fa7 100644 (file)
@@ -20,9 +20,6 @@
 
 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;
@@ -30,7 +27,7 @@ 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
@@ -188,7 +185,13 @@ public abstract class BaseTask implements JavaDelegate {
        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();
+               }
        }
        
        /**
@@ -524,14 +527,6 @@ public abstract class BaseTask implements JavaDelegate {
                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 {     }
 }