Package org.smartcomps.twister.deployer.exception

Examples of org.smartcomps.twister.deployer.exception.DeploymentException


                log.info("<" + e.getName() + ">");
                ActivityDeployer ad = null;
                try {
                    ad = ActivityDeployerFactory.getActivityDeployer(e.getName());
                } catch (DeploymentException ex) {
                    throw new DeploymentException(ex);
                }
                Activity returnedActivity = ad.deploy(e, (StructuredActivity) activity);
                // Setting a flag on a receive if it's immediately followed by a Reply
                if ("receive".equals(e.getName())) {
                    if (i < (eltsSize - 1)) {
View Full Code Here


        Activity activity = null;
//        log.debug("Creating " + StringUtil.getClassName(getActivityClass().getName()) + " ...");
        try {
            activity = ActivityFactory.createActivity(getActivityClass(), twisterProcess);
        } catch (DBSessionException e) {
            throw new DeploymentException(e);
        }
        processElements(element, activity);
        return activity;
    }
View Full Code Here

        Activity activity = null;
//        log.debug("Creating " + StringUtil.getClassName(getActivityClass().getName()) + " ...");
        try {
            activity = ActivityFactory.createActivity(getActivityClass(), parentActivity);
        } catch (DBSessionException e) {
            throw new DeploymentException(e);
        }

        processElements(element, activity);

        return activity;
View Full Code Here

        try {
            String strActivityName = StringUtil.capitalizeFirstCharacter(activityName);
            log.debug("Instantiate : " + "org.uengine.smcp.twister.deployer.priv." + strActivityName + "Deployer");
            activityDeployer = Class.forName("org.uengine.smcp.twister.deployer.priv." + strActivityName + "Deployer").newInstance();
        } catch (Exception e) {
            throw new DeploymentException("Unable to instanciate the activity deployer due to " + e.getMessage(), e);
        }
        return (ActivityDeployer) activityDeployer;
    }
View Full Code Here

            Element fromElement = copyElement.element("from");
            Element toElement = copyElement.element("to");

            if (fromElement == null || toElement == null) {
                throw new DeploymentException("The copy tag in an assigment MUST contains BOTH the FROM and the TO attributes !");
            }

            // processing the FROM type
            Attribute fromFirstAtt = null;
            Attribute fromSecondAtt = null;
            Attribute fromThirdAtt = null;

            int fromType = 0;
            String fromFirstValue = "";
            String fromSecondValue = "";
            String fromThirdValue = "";
            /*
                <from variable="ncname" part="ncname"? query="queryString"?/>
            */
            log.debug("<copy>");
            fromFirstAtt = fromElement.attribute("variable");
            fromSecondAtt = fromElement.attribute("part");
            fromThirdAtt = fromElement.attribute("query");
            if ((fromFirstAtt != null && fromElement.attributeCount() == 1)
                    || (fromSecondAtt != null || fromThirdAtt != null)) {
                fromType = Assignment.VARIABLE_PART;
                fromFirstValue = fromFirstAtt != null ? fromFirstAtt.getValue() : "";
                fromSecondValue = fromSecondAtt != null ? fromSecondAtt.getValue() : "";
                fromThirdValue = fromThirdAtt != null ? fromThirdAtt.getValue() : "";
                log.debug("     <from" +
                        (fromFirstAtt != null ? " variable=" + fromFirstValue : "") +
                        (fromSecondAtt != null ? " part=" + fromSecondValue : "") +
                        (fromThirdAtt != null ? " query=" + fromThirdValue : "") +
                        "/>");
            } else
            /*
                <from expression="general-expr"/>
            */ if ((fromFirstAtt = fromElement.attribute("expression")) != null) {
                fromType = Assignment.EXPRESSION;
                fromFirstValue = fromFirstAtt.getValue();
                log.debug("     <from" +
                        (fromFirstAtt != null ? " expression=" + fromFirstValue : "") +
                        "/>");
            } else
            /*
                <from partnerLink="ncname" endpointReference="myRole|partnerRole"/>
            */ if ((fromFirstAtt = fromElement.attribute("partnerLink")) != null &&
                    (fromSecondAtt = fromElement.attribute("endpointReference")) != null) {
                fromType = Assignment.PARTNER_REFERENCE;
                fromFirstValue = fromFirstAtt.getValue();
                fromSecondValue = fromSecondAtt.getValue();
                log.debug("     <from" +
                        (fromFirstAtt != null ? " partnerLink=" + fromFirstValue : "") +
                        (fromSecondAtt != null ? " endpointReference=" + fromSecondValue : "") +
                        "/>");
            } else
            /*
                <from variable="ncname" property="qname"/>
            */ if ((fromFirstAtt = fromElement.attribute("variable")) != null &&
                    (fromSecondAtt = fromElement.attribute("property")) != null) {
                fromType = Assignment.VARIABLE_PROPERTY;
                fromFirstValue = fromFirstAtt != null ? fromFirstAtt.getValue() : "";
                fromSecondValue = fromSecondAtt != null ? truncNamespace(fromSecondAtt.getValue()) : "";
                log.debug("     <from" +
                        (fromFirstAtt != null ? " variable=" + fromFirstValue : "") +
                        (fromSecondAtt != null ? " property=" + fromSecondValue : "") +
                        "/>");
            } else
            /*
                <from> ... literal value ... </from>
            */ if (fromElement.attributeCount() == 0) {
                fromType = Assignment.LITERAL;
                fromFirstValue = fromElement.getText();
                log.debug("     <from>" + fromFirstValue + "</from>");
            } else {
                throw new DeploymentException("The FROM attribute is invalid !");
            }

            // processing the TO type
            int toType = 0;
            String toFirstValue = "";
            String toSecondValue = "";
            String toThirdValue = "";

            Attribute toFirstAtt = null;
            Attribute toSecondAtt = null;
            Attribute toThirdAtt = null;

            /*
                <to variable="ncname" part="ncname"? query="queryString"?/>
            */
            toFirstAtt = toElement.attribute("variable");
            toSecondAtt = toElement.attribute("part");
            toThirdAtt = toElement.attribute("query");
            if ((toFirstAtt != null && toElement.attributeCount() == 1)
                    || (toSecondAtt != null || toThirdAtt != null)) {
                toType = Assignment.VARIABLE_PART;
                toFirstValue = toFirstAtt != null ? toFirstAtt.getValue() : "";
                toSecondValue = toSecondAtt != null ? toSecondAtt.getValue() : "";
                toThirdValue = toThirdAtt != null ? toThirdAtt.getValue() : "";
                log.debug("     <to" +
                        (toFirstAtt != null ? " variable=" + toFirstValue : "") +
                        (toSecondAtt != null ? " part=" + toSecondValue : "") +
                        (toThirdAtt != null ? " query=" + toThirdValue : "") +
                        "/>");
            } else
            /*
                <to partnerLink="ncname" endpointReference="myRole|partnerRole"/>
            */ if ((toFirstAtt = toElement.attribute("partnerLink")) != null &&
                    (toSecondAtt = toElement.attribute("endpointReference")) != null) {
                toType = Assignment.PARTNER_REFERENCE;
                toFirstValue = toFirstAtt.getValue();
                toSecondValue = toSecondAtt.getValue();
                log.debug("     <to" +
                        (toFirstAtt != null ? " partnerLink=" + toFirstValue : "") +
                        (toSecondAtt != null ? " endpointReference=" + toSecondValue : "") +
                        "/>");
            } else
            /*
                <to variable="ncname" property="qname"/>
            */ if ((toFirstAtt = toElement.attribute("variable")) != null &&
                    (toSecondAtt = toElement.attribute("property")) != null) {
                toType = Assignment.VARIABLE_PROPERTY;
                toFirstValue = toFirstAtt != null ? toFirstAtt.getValue() : "";
                toSecondValue = toSecondAtt != null ? truncNamespace(toSecondAtt.getValue()): "";
                log.debug("     <to" +
                        (toFirstAtt != null ? " variable=" + toFirstValue : "") +
                        (toSecondAtt != null ? " property=" + toSecondValue : "") +
                        "/>");
            } else {
                throw new DeploymentException("The TO attribute is invalid !");
            }

            Assignment assignment = null;
            try {
                assignment = ActivityFactory.addAssignment((Assign) activity, fromType, toType);
            } catch (DBSessionException e) {
                throw new DeploymentException(e);
            }

            assignment.setFromFirstValue(fromFirstValue);
            assignment.setFromSecondValue(fromSecondValue);
            assignment.setFromQuery(fromThirdValue);
View Full Code Here

    protected void processSpecificElements(Element element, Activity activity) throws DeploymentException {
        Element correlationsElement = element.element("correlations");
        try {
            processCorrelations(correlationsElement, (Reply) activity);
        } catch (DBSessionException e) {
            throw new DeploymentException(e);
        }
    }
View Full Code Here

        try {
            if (correlationsElement != null) {
                processCorrelations(correlationsElement, (Invoke) activity);
            }
        } catch (DBSessionException e) {
            throw new DeploymentException(e);
        }

        Iterator catchElements = element.elementIterator("catch");
        processCatchs(catchElements, (Invoke) activity);
View Full Code Here

        try {
            if (correlationsElement != null) {
                processCorrelations(correlationsElement, (Receive) activity);
            }
        } catch (DBSessionException e) {
            throw new DeploymentException(e);
        }
    }
View Full Code Here

    public void deploy(String xmlProcess, String xmlProcessDefinition) throws DeploymentException {
        try {
            deploy(getDocument(xmlProcess), getDocument(xmlProcessDefinition));
        } catch (DocumentException e) {
            log.error("Failed to deploy a XML description from a String.", e);
            throw new DeploymentException("unable to deploy the document", e);
        }
    }
View Full Code Here

                buffer.append(str);
            }
            deploy(getDocument(buffer.toString()), null);
        } catch (DocumentException e) {
            log.error("Failed to deploy a XML description from a stream.", e);
            throw new DeploymentException("unable to deploy the document", e);
        } catch (IOException e) {
            log.error("Failed to deploy a XML description from a stream.", e);
            throw new DeploymentException("unable to deploy the document", e);
        }
        log.exiting(CLASSNAME, methodName);
    }
View Full Code Here

TOP

Related Classes of org.smartcomps.twister.deployer.exception.DeploymentException

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.