sendEvent(new ActivityExecEndEvent());
if (faultData != null) {
dpe(_oactivity.sourceLinks);
_self.parent.completed(faultData, compensations);
} else {
FaultData fault = null;
for (Iterator<OLink> i = _oactivity.sourceLinks.iterator();i.hasNext();) {
OLink olink = i.next();
LinkInfo linfo = _linkFrame.resolve(olink);
try {
boolean val = evaluateTransitionCondition(olink.transitionCondition);
linfo.pub.linkStatus(val);
} catch (FaultException e) {
linfo.pub.linkStatus(false);
__log.error(e);
if (fault == null)
fault = createFault(e.getQName(),olink.transitionCondition);
}
}
_self.parent.completed(fault, compensations);
}
}
public void cancelled() {
sendEvent(new ActivityExecEndEvent());
dpe(_oactivity.outgoingLinks);
dpe(_oactivity.sourceLinks);
// Implicit scope can tell the difference between cancelled and completed.
_self.parent.cancelled();
}
private OFailureHandling getFailureHandling() {
if (_oactivity instanceof OInvoke) {
OInvoke _oinvoke = (OInvoke) _oactivity;
OFailureHandling f = getBpelRuntimeContext().getConfigForPartnerLink(_oinvoke.partnerLink).failureHandling;
if (f != null) return f;
}
return _oactivity.getFailureHandling();
}
public void failure(String reason, Element data) {
if (_failure == null)
_failure = new ActivityFailure();
_failure.dateTime = new Date();
_failure.reason = reason;
_failure.data = data;
OFailureHandling failureHandling = getFailureHandling();
if (failureHandling != null && failureHandling.faultOnFailure && _failure.retryCount >= failureHandling.retryFor) {
//Fault after retries (may be 0)
if (__log.isDebugEnabled())
__log.debug("ActivityRecovery: Activity " + _self.aId + " faulting on failure");
FaultData faultData = createFault(OFailureHandling.FAILURE_FAULT_NAME, _oactivity, reason);
completed(faultData, CompensationHandler.emptySet());
return;
}
if (failureHandling == null || _failure.retryCount >= failureHandling.retryFor) {
requireRecovery();