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

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


                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;
            try {
                // prepare to invoke service2
                result = runService2(service2, service2.getWorkflowID(), service2.getServiceID(),
                        service2.getWorkflowNodeID(), service2.getWorkflowTimestep());

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


            notifier.serviceInitialized(context, SERVICE_2);
        }

        {
            GenericNotifier notifier = NotifierFactory.createGenericNotifier();
            InvocationEntity initiatingService = notifier.createEntity(null, SERVICE_0, null, null);

            runWorkflow1(initiatingService, null, WORKFLOW_1, null, null);
        }

        // terminate workflow and service instances
View Full Code Here

    /**
     * {@inheritDoc}
     *
     */
    public DataObj dataConsumed(WorkflowTrackingContext context, DataObj dataObj, String... descriptionAndAnnotation) {
        InvocationEntity entity = context.getMyself();
        if (entity == null)
            throw new RuntimeException("Local entity passed was NULL.");
        if (dataObj == null)
            throw new RuntimeException("Data object passed was NULL.");
        if (dataObj.getId() == null)
View Full Code Here

    /**
     * {@inheritDoc}
     *
     */
    public DataObj dataProduced(WorkflowTrackingContext context, DataObj dataObj, String... descriptionAndAnnotation) {
        InvocationEntity entity = context.getMyself();
        if (entity == null)
            throw new RuntimeException("Local entity passed was NULL.");
        if (dataObj == null)
            throw new RuntimeException("Data object passed was NULL.");
        if (dataObj.getId() == null)
View Full Code Here

        URI myWorkflowID = null;
        URI myServiceID = URI.create(XBayaConstants.APPLICATION_SHORT_NAME);
        String myNodeID = null;
        Integer myTimestep = null;
        InvocationEntity myEntity = notifier.createEntity(myWorkflowID, myServiceID, myNodeID, myTimestep);

        URI serviceWorkflowID = null;
        URI serviceServiceID = URI.create("ServiceID");
        String serviceNodeID = nodeID;
        Integer serviceTimestep = null;
        InvocationEntity serviceEntity = notifier.createEntity(serviceWorkflowID, serviceServiceID, serviceNodeID,
                serviceTimestep);
        WorkflowTrackingContext workflowContext = notifier.createTrackingContext(new Properties(), this.configuration
                .getBrokerURL().toASCIIString(), myWorkflowID, myServiceID, myNodeID, myTimestep);

        XmlElement inputBody = (XmlElement) ((XmlElement) inputMessage).getParent();
View Full Code Here

        URI myWorkflowID = null;
        URI myServiceID = URI.create(XBayaConstants.APPLICATION_SHORT_NAME);
        String myNodeID = null;
        Integer myTimestep = null;
        InvocationEntity myEntity = notifier.createEntity(myWorkflowID, myServiceID, myNodeID, myTimestep);

        URI serviceWorkflowID = null;
        URI serviceServiceID = URI.create("ServiceID");
        String serviceNodeID = nodeID;
        Integer serviceTimestep = null;
        InvocationEntity serviceEntity = notifier.createEntity(serviceWorkflowID, serviceServiceID, serviceNodeID,
                serviceTimestep);
        WorkflowTrackingContext workflowContext = notifier.createTrackingContext(new Properties(), this.configuration
                .getBrokerURL().toASCIIString(), myWorkflowID, myServiceID, myNodeID, myTimestep);

        XmlElement inputBody = (XmlElement) ((XmlElement) inputMessage).getParent();
View Full Code Here

    /**
     * {@inheritDoc}
     *
     */
    public DataObj dataConsumed(WorkflowTrackingContext context, DataObj dataObj, String... descriptionAndAnnotation) {
        InvocationEntity entity = context.getMyself();
        if (entity == null)
            throw new RuntimeException("Local entity passed was NULL.");
        if (dataObj == null)
            throw new RuntimeException("Data object passed was NULL.");
        if (dataObj.getId() == null)
View Full Code Here

    /**
     * {@inheritDoc}
     *
     */
    public DataObj dataProduced(WorkflowTrackingContext context, DataObj dataObj, String... descriptionAndAnnotation) {
        InvocationEntity entity = context.getMyself();
        if (entity == null)
            throw new RuntimeException("Local entity passed was NULL.");
        if (dataObj == null)
            throw new RuntimeException("Data object passed was NULL.");
        if (dataObj.getId() == null)
View Full Code Here

        URI myWorkflowID = null;
        URI myServiceID = URI.create(XBayaConstants.APPLICATION_SHORT_NAME);
        String myNodeID = null;
        Integer myTimestep = null;
        InvocationEntity myEntity = notifier.createEntity(myWorkflowID, myServiceID, myNodeID, myTimestep);

        URI serviceWorkflowID = null;
        URI serviceServiceID = URI.create("ServiceID");
        String serviceNodeID = nodeID;
        Integer serviceTimestep = null;
        InvocationEntity serviceEntity = notifier.createEntity(serviceWorkflowID, serviceServiceID, serviceNodeID,
                serviceTimestep);
        WorkflowTrackingContext workflowContext = notifier.createTrackingContext(new Properties(), this.configuration
                .getBrokerURL().toASCIIString(), myWorkflowID, myServiceID, myNodeID, myTimestep);

        XmlElement inputBody = (XmlElement) ((XmlElement) inputMessage).getParent();
View Full Code Here

TOP

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

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.