Package org.wso2.carbon.rulecep.commons

Examples of org.wso2.carbon.rulecep.commons.LoggedRuntimeException


            }
        } */

        //pls use a function to find the closest activity to the flow start
        //as well as the closest activity to the flow end;
        SVGCoordinates myStartCoords = getStartIconExitArrowCoords();
        SVGCoordinates myExitCoords = getEndIconEntryArrowCoords();

        subGroup.appendChild(getArrowDefinition(doc, myStartCoords.getXLeft(), myStartCoords.getYTop(),
                myStartCoords.getXLeft(), (myStartCoords.getYTop() + 30), "Flow_Top", true));
        subGroup.appendChild(getArrowDefinition(doc, (myStartCoords.getXLeft() - dimensions.getWidth()/2 + getXSpacing()),
                (myStartCoords.getYTop() + 30), (myStartCoords.getXLeft() + dimensions.getWidth()/2 - getXSpacing()),
                (myStartCoords.getYTop() + 30), "Flow_TopH", true));
        subGroup.appendChild(getArrowDefinition(doc, (myStartCoords.getXLeft() - dimensions.getWidth()/2 + getXSpacing()),
                (myExitCoords.getYTop() - 20), (myStartCoords.getXLeft() + dimensions.getWidth()/2 - getXSpacing()),
                (myExitCoords.getYTop() - 20), "Flow_DownH", true));
        subGroup.appendChild(getArrowDefinition(doc, myExitCoords.getXLeft(), myExitCoords.getYTop() - 20,
                myExitCoords.getXLeft(), myExitCoords.getYTop(), "Flow_Top", false));

        return subGroup;
    }
View Full Code Here


            xLeft = getDimensions().getXLeft() + BOX_MARGIN;
            yTop = getDimensions().getYTop() + (getDimensions().getHeight() / 2);

        }

        SVGCoordinates coords = new SVGCoordinates(xLeft, yTop);

        return coords;
    }
View Full Code Here

    @Override
    public SVGDimension getDimensions() {
        if (dimensions == null) {
            int width = 0;
            int height = 0;
            dimensions = new SVGDimension(width, height);

            SVGDimension subActivityDim = null;
            ActivityInterface activity = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = getSubActivities().iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                subActivityDim = activity.getDimensions();
                if (subActivityDim.getWidth() > width) {
                    width += subActivityDim.getWidth();
                }
                height += subActivityDim.getHeight();
            }

            height += getYSpacing();
            width += getXSpacing();
View Full Code Here

        if (dimensions == null) {
            int width = 0;
            int height = 0;
            dimensions = new org.wso2.carbon.bpel.ui.bpel2svg.SVGDimension(width, height);

            SVGDimension subActivityDim = null;
            org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface activity = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = getSubActivities().iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                subActivityDim = activity.getDimensions();
                if (subActivityDim.getWidth() > width) {
                    width += subActivityDim.getWidth();
                }
                height += subActivityDim.getHeight();
            }

            height += getYSpacing() + getStartIconHeight() + (getYSpacing() / 2);
            width += getXSpacing();
View Full Code Here

     * @return <code>BaseXPath</code>
     */
    public BaseXPath getXPath(String expression) {

        if (expression == null || "".equals(expression)) {
            throw new LoggedRuntimeException("Given expression is empty or null.", log);
        }

        BaseXPath baseXPath = xPathMap.get(expression);
        if (baseXPath != null) {
            if (log.isDebugEnabled()) {
View Full Code Here

    }


    private void assertResourceDescriptionNull(ResourceDescription resourceDescription) {
        if (resourceDescription == null) {
            throw new LoggedRuntimeException("Given adapter description is null", log);
        }
    }
View Full Code Here

     * @return <code>String</code> representation of the given object
     */
    public static String toString(Object value, Map<String, Object> properties) {

        if (value == null) {
            throw new LoggedRuntimeException("Cannot convert null object to a string", log);
        }

        if (value instanceof String) {
            return (String) value;
        }

        if (value instanceof OMElement) {
            return ((OMElement) (value)).getText();
        } else if (value instanceof OMText) {
            DataHandler dataHandler = (DataHandler) ((OMText) value).getDataHandler();
            if (dataHandler != null) {
                try {
                    return toString(dataHandler.getInputStream());
                } catch (IOException e) {
                    throw new LoggedRuntimeException("Error in reading content as a string ", log);
                }
            } else {
                return ((OMText) value).getText();
            }
        } else if (value instanceof URI) {
            try {
                return toString(((URI) (value)).toURL().openStream());
            } catch (IOException e) {
                throw new LoggedRuntimeException("Error opening stream form URI", e, log);
            }
        } else {
            throw new LoggedRuntimeException("Cannot convert object to a String", log);
        }

    }
View Full Code Here

        try {
            while ((str = br.readLine()) != null) {
                sb.append(str);
            }
        } catch (IOException e) {
            throw new LoggedRuntimeException("Error converting stream to String ", e, log);
        } finally {
            try {
                br.close();
            } catch (IOException ignored) {
            }
View Full Code Here

            } else {
                OMElement inLinedSource = ruleSet.getFirstElement();
                if (inLinedSource == null) {
                    String inLinedText = ruleSet.getText();
                    if (inLinedText == null || "".equals(inLinedText.trim())) {
                        throw new LoggedRuntimeException("The cep query source cannot be found " +
                                "from either in-lined or key. It is required.", log);
                    } else {
                        description.setQuerySource(inLinedText.trim());
                    }
                } else {
View Full Code Here

    public OMElement serialize(ExtensibleConfiguration configuration,
                               XPathSerializer xPathSerializer,
                               OMElement parent) {

        if (!(configuration instanceof RuleSetDescription)) {
            throw new LoggedRuntimeException("Invalid rule configuration," +
                    "expect RuleSetDescription.", log);
        }

        RuleSetDescription description = (RuleSetDescription) configuration;
        String key = description.getKey();
        String path = description.getPath();
        Object inLinedScript = description.getRuleSource();

        if (key == null && inLinedScript == null && path == null) {
            throw new LoggedRuntimeException("Invalid Configuration !!- Either script in-lined " +
                    "value or key or path should be presented", log);
        }

        if (key != null && !"".equals(key)) {
            parent.addAttribute(OM_FACTORY.createOMAttribute(
View Full Code Here

TOP

Related Classes of org.wso2.carbon.rulecep.commons.LoggedRuntimeException

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.