public void run(Metadata metadata, WorkflowTaskConfiguration config)
throws WorkflowTaskInstanceException {
String conditionClassName = config.getProperty("ConditionClassName");
if (conditionClassName == null
|| (conditionClassName != null && conditionClassName.equals(""))) {
throw new WorkflowTaskInstanceException(
"Condition class name is null or " + "unreadable: ["
+ conditionClassName + "]: unable to run ConditionTaskInstance!");
}
LOG.log(Level.INFO, "ConditionTaskInstance: evaluating condition: ["
+ conditionClassName + "]");
WorkflowConditionInstance cond = GenericWorkflowObjectFactory
.getConditionObjectFromClassName(conditionClassName);
WorkflowConditionConfiguration condConfig = fromWorkflowTaskConfig(config);
if (!cond.evaluate(metadata, condConfig)) {
throw new WorkflowTaskInstanceException("Condition: ["
+ conditionClassName + "] failed!");
}
}