}
protected Date getDueDate() throws FaultException, EvaluationException {
OWait wait = (OWait)_self.o;
// Assume the data was well formed (we have a deadline or a duration)
assert wait.hasFor() || wait.hasUntil();
EvaluationContext evalCtx = getEvaluationContext();
Date dueDate = null;
if (wait.hasFor()) {
Calendar cal = Calendar.getInstance();
Duration duration = getBpelRuntimeContext().getExpLangRuntime().evaluateAsDuration(wait.forExpression, evalCtx);
duration.addTo(cal);
dueDate = cal.getTime();
} else if (wait.hasUntil()) {
Calendar cal = getBpelRuntimeContext().getExpLangRuntime().evaluateAsDate(wait.untilExpression, evalCtx);
dueDate = cal.getTime();
} else {
throw new AssertionError("Static checks failed to find bad WaitActivity!");
}