use of org.camunda.bpm.engine.impl.pvm.delegate.SignallableActivityBehavior in project camunda-bpm-platform by camunda.
the class ServiceTaskDelegateExpressionActivityBehavior method doSignal.
public void doSignal(final ActivityExecution execution, final String signalName, final Object signalData) throws Exception {
Object delegate = expression.getValue(execution);
applyFieldDeclaration(fieldDeclarations, delegate);
final ActivityBehavior activityBehaviorInstance = getActivityBehaviorInstance(execution, delegate);
if (activityBehaviorInstance instanceof CustomActivityBehavior) {
CustomActivityBehavior behavior = (CustomActivityBehavior) activityBehaviorInstance;
ActivityBehavior delegateActivityBehavior = behavior.getDelegateActivityBehavior();
if (!(delegateActivityBehavior instanceof SignallableActivityBehavior)) {
// legacy behavior: do nothing when it is not a signallable activity behavior
return;
}
}
executeWithErrorPropagation(execution, new Callable<Void>() {
@Override
public Void call() throws Exception {
((SignallableActivityBehavior) activityBehaviorInstance).signal(execution, signalName, signalData);
return null;
}
});
}
use of org.camunda.bpm.engine.impl.pvm.delegate.SignallableActivityBehavior in project camunda-bpm-platform by camunda.
the class ClassDelegateActivityBehavior method doSignal.
protected void doSignal(final ActivityExecution execution, final String signalName, final Object signalData) throws Exception {
final ActivityBehavior activityBehaviorInstance = getActivityBehaviorInstance(execution);
if (activityBehaviorInstance instanceof CustomActivityBehavior) {
CustomActivityBehavior behavior = (CustomActivityBehavior) activityBehaviorInstance;
ActivityBehavior delegate = behavior.getDelegateActivityBehavior();
if (!(delegate instanceof SignallableActivityBehavior)) {
throw LOG.incorrectlyUsedSignalException(SignallableActivityBehavior.class.getName());
}
}
executeWithErrorPropagation(execution, new Callable<Void>() {
@Override
public Void call() throws Exception {
((SignallableActivityBehavior) activityBehaviorInstance).signal(execution, signalName, signalData);
return null;
}
});
}
Aggregations