}
private void runCorrelateProcess(final boolean bomb) throws Exception {
final AtomicInteger counter = new AtomicInteger();
final Holder holder = new Holder();
Service callService = serviceDomain.registerService(new QName("CallService"), new InOnlyService(), new BaseHandler(){
public void handleMessage(Exchange exchange) throws HandlerException {
int count = counter.incrementAndGet();
holder.setValue(String.valueOf(count));
}
});
serviceDomain.registerServiceReference(callService.getName(), callService.getInterface(), callService.getProviderHandler());
BPMComponentImplementationModel bci_model = (BPMComponentImplementationModel)new BPMSwitchYardScanner().scan(ControlProcess.class).getImplementation();
// setting the component name to null so that the service reference doesn't use the component-qualified name
bci_model.getComponent().setName(null);
QName serviceName = new QName("ControlProcess");
BPMExchangeHandler handler = new BPMExchangeHandler(bci_model, serviceDomain, serviceName);
Service controlService = serviceDomain.registerService(serviceName, JavaService.fromClass(ControlProcess.class), handler);
serviceDomain.registerServiceReference(controlService.getName(), controlService.getInterface(), controlService.getProviderHandler());
handler.start();
new Invoker(serviceDomain, serviceName).operation("process").property(CORRELATION_KEY_PROPERTY, "A").sendInOnly(null);
new Invoker(serviceDomain, serviceName).operation("process").property(CORRELATION_KEY_PROPERTY, "B").sendInOnly(null);
new Invoker(serviceDomain, serviceName).operation("signal").property(CORRELATION_KEY_PROPERTY, "A").sendInOnly(null);
InvocationFaultException fault = null;