/* * GenericHandler.java * * Created on April 1, 2008, 7:06 PM * * Copyright 2008, Britt Miner. */ package org.bminer.jbpm.pd; import org.jbpm.graph.exe.ExecutionContext; import org.bminer.jbpm.util.*; /** * * @author bminer */ public abstract class GenericHandler { ElHelper elHelper = new ElHelper(); protected String conditionExpression = null; /* Returns True if the conditionExpression is empty or evaluates to True. Returns * False if the conditionExpression is not empty and returns False. */ protected boolean checkCondition(ExecutionContext ec) { return elHelper.evaluateElAsCondition(conditionExpression, ec); } /* Evaluate the input as a possible EL expression. */ protected Object evaluateEL(String inputStr, ExecutionContext ec) { return elHelper.evaluateEL(inputStr, ec); } /* Treats input as a possible series of EL expressions and concatenates what * is found. */ protected String concatenateEL(String inputStr, ExecutionContext ec) { return elHelper.concatenateEL(inputStr, ec); } /* Returns true if the value is a String which contains the pattern delineating * an EL expression. */ protected boolean hasEL(Object value) { return elHelper.hasEL(value); } /* Returns true if the value is a String which in its entirety composes * one EL expression. */ protected boolean isEL(Object value) { return elHelper.isEL(value); } protected boolean evaluateElAsCondition(String inputStr, ExecutionContext ec) { return elHelper.evaluateElAsCondition(inputStr, ec); } public void setConditionExpression(String condition) { this.conditionExpression = condition.trim(); } public void setCondition(String condition) { this.conditionExpression = condition.trim(); } }