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.channel.linkStatus(val);
} catch (FaultException e) {
linfo.channel.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();
}
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 = _oactivity.getFailureHandling();
if (failureHandling != null && failureHandling.faultOnFailure) {
// No attempt to retry or enter activity recovery state, simply fault.
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();