Package org.apache.airavata.workflow.tracking.common

Examples of org.apache.airavata.workflow.tracking.common.InvocationContext


        WorkflowNotifier notifier = NotifierFactory.createWorkflowNotifier();
        WorkflowTrackingContext context = notifier.createTrackingContext(new Properties(), BROKER_URL, myWorkflowID,
                myServiceID, myNodeID, myTimestep);

        InvocationContext myInvocation = notifier.workflowInvoked(context, myInvoker,
                XmlObject.Factory.parse("<soapHeader/>"),
                XmlObject.Factory.parse("<soapBody>input1,input2</soapBody>"), "This is the start of this workflow");

        // BEGIN SERVICE1
        {
            // prepare to invoke service1
            InvocationEntity service1 = notifier.createEntity(myServiceID, SERVICE_1, "NODE1", 1);
            InvocationContext service1Invocation = notifier.invokingService(context, service1,
                    XmlObject.Factory.parse("<soapHeader/>"), XmlObject.Factory.parse("<soapBody>input1</soapBody>"),
                    "This workflow is invoking a service");

            Object result = null;
            try {
                // prepare to invoke service1
                result = runService1(service1, service1.getWorkflowID(), service1.getServiceID(),
                        service1.getWorkflowNodeID(), service1.getWorkflowTimestep());

                // If this were an async invocation, we would have finished
                // sending request.
                // we acknowledge the successful request.
                notifier.invokingServiceSucceeded(context, service1Invocation, "Invoked service1 successfully");

            } catch (Exception ex) {
                // If there had been a problem sending the request on the wire,
                // we acknowledge a failed request.
                notifier.invokingServiceFailed(context, service1Invocation, ex, "Failed to invoke service1");
            }

            // At this point, we would have waited for response from service1 if
            // it were an async call.
            // assume we received response at this point and continue.
            if (result instanceof Success) {
                notifier.receivedResult(context, service1Invocation, ((Success) result).header,
                        ((Success) result).body, "got success response from service1");
            } else if (result instanceof Failure) {
                notifier.receivedFault(context, service1Invocation, ((Failure) result).header, ((Failure) result).body,
                        "got fault response from service1");
            }

        }

        // BEGIN SERVICE2
        {
            // prepare to invoke service1
            InvocationEntity service2 = notifier.createEntity(myServiceID, SERVICE_2, "NODE2", 2);
            InvocationContext service1Invocation = notifier.invokingService(context, service2,
                    XmlObject.Factory.parse("<soapHeader/>"),
                    XmlObject.Factory.parse("<soapBody>input2,input3</soapBody>"),
                    "This workflow is invoking another service");

            Object result = null;
View Full Code Here


        // if we were not publishing data products, a serviceNotifier would have
        // sufficed
        ProvenanceNotifier notifier = NotifierFactory.createProvenanceNotifier();
        WorkflowTrackingContext context = notifier.createTrackingContext(null, BROKER_URL, myWorkflowID, myServiceID,
                myNodeID, myTimestep);
        InvocationContext invocationContext = notifier.serviceInvoked(context, myInvoker,
                "I (service1) was invoked by my invoker",
                AnnotationProps.newProps(AnnotationConsts.AbstractServiceID, myServiceID.toString() + "-abstract")
                        .toString());

        notifier.dataConsumed(context, DATA_URI_1, DATA_URLS_1, "consuming a file");
View Full Code Here

        ProvenanceNotifier notifier = NotifierFactory.createProvenanceNotifier();

        // received request
        WorkflowTrackingContext context = notifier.createTrackingContext(null, BROKER_URL, myWorkflowID, myServiceID,
                myNodeID, myTimestep);
        InvocationContext invocationContext = notifier.serviceInvoked(context, myInvoker,
                "I (service2) was invoked by my invoker");

        notifier.dataConsumed(context, DATA_URI_2, DATA_URLS_2, "consuming file used by service1");
        notifier.dataConsumed(context, DATA_URI_3, DATA_URLS_3);
        notifier.dataConsumed(context, DATA_URI_4, DATA_URLS_4, null, "<dataXml>boo</dataXml>");
View Full Code Here

                .getBrokerURL().toASCIIString(), myWorkflowID, myServiceID, myNodeID, myTimestep);

        XmlElement inputBody = (XmlElement) ((XmlElement) inputMessage).getParent();
        XmlObject inputBodyObject = XBeansUtil.xmlElementToXmlObject(inputBody);

        InvocationContext context = notifier.invokingService(workflowContext, serviceEntity, null, inputBodyObject);

        if (outputMap != null) {
            WSIFMessage outputMessage = operation.createOutputMessage();
            Soap11Util.getInstance().wrapBodyContent((XmlElement) outputMessage);
            for (String key : outputMap.keySet()) {
View Full Code Here

                .getBrokerURL().toASCIIString(), myWorkflowID, myServiceID, myNodeID, myTimestep);

        XmlElement inputBody = (XmlElement) ((XmlElement) inputMessage).getParent();
        XmlObject inputBodyObject = XBeansUtil.xmlElementToXmlObject(inputBody);

        InvocationContext context = notifier.invokingService(workflowContext, serviceEntity, null, inputBodyObject);

        if (outputMap != null) {
            WSIFMessage outputMessage = operation.createOutputMessage();
            Soap11Util.getInstance().wrapBodyContent((XmlElement) outputMessage);
            for (String key : outputMap.keySet()) {
View Full Code Here

                .getBrokerURL().toASCIIString(), myWorkflowID, myServiceID, myNodeID, myTimestep);

        XmlElement inputBody = (XmlElement) ((XmlElement) inputMessage).getParent();
        XmlObject inputBodyObject = XBeansUtil.xmlElementToXmlObject(inputBody);

        InvocationContext context = notifier.invokingService(workflowContext, serviceEntity, null, inputBodyObject);

        if (outputMap != null) {
            WSIFMessage outputMessage = operation.createOutputMessage();
            Soap11Util.getInstance().wrapBodyContent((XmlElement) outputMessage);
            for (String key : outputMap.keySet()) {
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.tracking.common.InvocationContext

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.