Package org.switchyard.component.common.knowledge.service

Examples of org.switchyard.component.common.knowledge.service.SwitchYardServiceInvoker$FaultHandler


                    if (serviceName != null && componentName != null) {
                        serviceName = ComponentNames.qualify(componentName, ComponentNames.unqualify(serviceName));
                    }
                    sysc.setServiceName(serviceName);
                    sysc.setOperationName(channelModel.getOperation());
                    sysc.setInvoker(new SwitchYardServiceInvoker(domain, componentTNS));
                }
                if (name == null) {
                    throw CommonKnowledgeMessages.MESSAGES.couldNotUseNullNameToRegisterChannel(channel.getClass().getName());
                }
                ncList.add(new NameChannel(name, channel));
View Full Code Here


                        ssth.setName(name);
                    } else {
                        name = ssth.getName();
                    }
                    ssth.setComponentName(componentName);
                    ssth.setInvoker(new SwitchYardServiceInvoker(serviceDomain, componentTNS));
                    ssth.setProcessRuntime(processRuntime);
                }
                if (name == null && workItemHandler instanceof AbstractHTWorkItemHandler) {
                    name = HUMAN_TASK;
                }
                if (name == null) {
                    throw BPMMessages.MESSAGES.couldNotUseNullNameToRegisterWorkItemHandler(workItemHandler.getClass().getName());
                }
                processRuntime.getWorkItemManager().registerWorkItemHandler(name, workItemHandler);
                registeredNames.add(name);
            }
        }
        for (Entry<String, Class<? extends WorkItemHandler>> entry : DEFAULT_HANDLERS.entrySet()) {
            String name = entry.getKey();
            if (!registeredNames.contains(name)) {
                WorkItemHandler defaultHandler = newWorkItemHandler(entry.getValue(), processRuntime, runtimeManager);
                if (defaultHandler instanceof SwitchYardServiceTaskHandler) {
                    SwitchYardServiceTaskHandler ssth = (SwitchYardServiceTaskHandler)defaultHandler;
                    ssth.setName(name);
                    ssth.setComponentName(componentName);
                    ssth.setInvoker(new SwitchYardServiceInvoker(serviceDomain, componentTNS));
                    ssth.setProcessRuntime(processRuntime);
                }
                processRuntime.getWorkItemManager().registerWorkItemHandler(name, defaultHandler);
                registeredNames.add(name);
            }
View Full Code Here

        kbuilder.add(ResourceFactory.newClassPathResource(CALL_SERVICE_BPMN), ResourceType.BPMN2);
        KieBase kbase = kbuilder.newKnowledgeBase();
        KieSession ksession = kbase.newKieSession();
        SwitchYardServiceTaskHandler ssth = new SwitchYardServiceTaskHandler();
        ssth.setProcessRuntime(ksession);
        ssth.setInvoker(new SwitchYardServiceInvoker(serviceDomain));
        ksession.getWorkItemManager().registerWorkItemHandler(ssth.getName(), ssth);
        ksession.startProcess("CallService");
        ksession.halt();
        ksession.dispose();
        Assert.assertEquals("message handled", holder.getValue());
View Full Code Here

        kbuilder.add(ResourceFactory.newClassPathResource(FAULT_RESULT_PROCESS_BPMN), ResourceType.BPMN2);
        KieBase kbase = kbuilder.newKnowledgeBase();
        KieSession ksession = kbase.newKieSession();
        SwitchYardServiceTaskHandler ssth = new SwitchYardServiceTaskHandler();
        ssth.setProcessRuntime(ksession);
        ssth.setInvoker(new SwitchYardServiceInvoker(serviceDomain));
        ksession.getWorkItemManager().registerWorkItemHandler(ssth.getName(), ssth);
        WorkflowProcessInstance wpi = (WorkflowProcessInstance)ksession.startProcess("FaultResultProcess");
        HandlerException he = (HandlerException)wpi.getVariable("faultResult");
        if (bomb) {
            Assert.assertNotNull(he);
View Full Code Here

        kbuilder.add(ResourceFactory.newClassPathResource(FAULT_EVENT_PROCESS_BPMN), ResourceType.BPMN2);
        KieBase kbase = kbuilder.newKnowledgeBase();
        KieSession ksession = kbase.newKieSession();
        SwitchYardServiceTaskHandler ssth = new SwitchYardServiceTaskHandler();
        ssth.setProcessRuntime(ksession);
        ssth.setInvoker(new SwitchYardServiceInvoker(serviceDomain));
        ksession.getWorkItemManager().registerWorkItemHandler(ssth.getName(), ssth);
        WorkflowProcessInstance wpi = (WorkflowProcessInstance)ksession.startProcess("FaultEventProcess");
        HandlerException he = (HandlerException)wpi.getVariable("faultEvent");
        if (bomb) {
            Assert.assertNotNull(he);
View Full Code Here

        kbuilder.add(ResourceFactory.newClassPathResource(FAULT_BOUNDARY_PROCESS_BPMN), ResourceType.BPMN2);
        KieBase kbase = kbuilder.newKnowledgeBase();
        KieSession ksession = kbase.newKieSession();
        SwitchYardServiceTaskHandler ssth = new SwitchYardServiceTaskHandler();
        ssth.setProcessRuntime(ksession);
        ssth.setInvoker(new SwitchYardServiceInvoker(serviceDomain));
        ksession.getWorkItemManager().registerWorkItemHandler(ssth.getName(), ssth);
        WorkflowProcessInstance wpi = (WorkflowProcessInstance)ksession.startProcess("FaultBoundaryProcess");
        String output = (String)wpi.getVariable("TestOutput");
        Assert.assertEquals(bomb ? "Failure" : "Success", output);
        ksession.halt();
View Full Code Here

TOP

Related Classes of org.switchyard.component.common.knowledge.service.SwitchYardServiceInvoker$FaultHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.