Package org.enhydra.shark.xpdl

Examples of org.enhydra.shark.xpdl.XMLElement


        String type = null;
        String subtype = null;
        String userSpec = null;
        if (isWorkflowElement) {
            XMLElement el = (XMLElement) ((DefaultGraphCell) cell).getUserObject();
            if (cell instanceof GraphActivityInterface && !(cell instanceof GraphBubbleActivityInterface)) {
                type = JaWEConstants.ACTIVITY_TYPE;
                subtype = Utils.getActivityStringType(((Activity) el).getActivityType());
                userSpec = JaWEManager.getInstance().getJaWEController().getTypeResolver().getJaWEType(el).getTypeId();
            }
View Full Code Here


            // normal
            if (pPort != firstPort) {
                if (validateConnection(firstPort, pPort, null)) {
                    GraphActivityInterface s = ((GraphPortInterface) firstPort.getCell()).getActivity();
                    GraphActivityInterface t = ((GraphPortInterface) pPort.getCell()).getActivity();
                    XMLElement sxpdl = s.getPropertyObject();
                    XMLElement txpdl = t.getPropertyObject();
                    if (sxpdl instanceof Activity && txpdl instanceof Activity) {
                        Transitions tras = (Transitions) getGraph().getXPDLObject().get("Transitions");
                        String fromId = ((Activity) sxpdl).getId();
                        String toId = ((Activity) txpdl).getId();
                        Transition tra = JaWEManager.getInstance().getXPDLObjectFactory().createXPDLObject(tras, subType, false);
View Full Code Here

      return id;
   }

   public boolean isIdUnique (XMLCollectionElement el,String newId) {

      XMLElement parent=el.getParent();
      if(el instanceof Tool) return true;
      else if(el instanceof Activity) return checkActivityId( (Activity)el,newId );
      else if(el instanceof Transition) return checkTransitionId( (Transition)el,newId );
      else if (parent instanceof XMLCollection) {
         List elsWithId=getElementsForId((XMLCollection)parent, newId);
View Full Code Here

    public boolean fillFromTemplate(XMLElement el, String tmplId) {
        if (tmplId == null) {
            return false;
        }
        XMLElement tmplEl = (XMLElement) templateMap.get(tmplId);
        if (tmplEl != null) {
            el.makeAs(tmplEl);
            return true;
        }
        return false;
View Full Code Here

            try {
                String templateXML = ResourceManager.getResourceString(properties,
                        "JaWETypes." + name + "." + XPDL_TEMPLATE + "." + types.get(i));
                if (templateXML != null && !templateXML.equals("")) {
                    Document doc = parseDocument(templateXML, true);
                    XMLElement tmpl = createTemplateElement(doc);
                    templateMap.put(id, tmpl);
                }

            } catch (Exception e) {
            }
View Full Code Here

    protected XMLElement createTemplateElement(Document doc) throws Exception {
        Element elem = doc.getDocumentElement();
        String elName = elem.getNodeName();
        elName = "org.enhydra.shark.xpdl.elements." + elName;
        XMLElement el = null;
        if (!elName.endsWith("Package")) {
            el = (XMLElement) Class.forName(elName).getConstructors()[0].newInstance(new Object[]{
                        null
                    });
        } else {
View Full Code Here

                    XMLAttribute attr = (XMLAttribute) attributes.get(i);
                    str += "\n\t    " + i + ". attribute [" + attr.toName() + "," + attr.toValue() + "]";
                }
                List elems = ((XMLComplexElement) el).getXMLElements();
                for (int i = 0; i < elems.size(); i++) {
                    XMLElement attr = (XMLElement) elems.get(i);
                    if (attr instanceof XMLSimpleElement) {
                        str += "\n\t    " + i + ". simple el [" + attr.toName() + "," + attr.toValue() + "]";
                    } else {
                        toString(attr);
                    }
                }
                System.err.println(str);
            } else if (el instanceof XMLCollection) {
                String str = "\n\tElement type=" + el.toName();
                List elems = ((XMLCollection) el).toElements();
                for (int i = 0; i < elems.size(); i++) {
                    XMLElement attr = (XMLElement) elems.get(i);
                    if (attr instanceof XMLAttribute) {
                        str += "\n\t    " + i + ". attribute [" + attr.toName() + "," + attr.toValue() + "]";
                    }
                    if (attr instanceof XMLSimpleElement) {
                        str += "\n\t    " + i + ". simple el [" + attr.toName() + "," + attr.toValue() + "]";
                    } else {
                        toString(attr);
                    }
                }
                System.err.println(str);
View Full Code Here

                    XMLComplexElement cmplxEl = (XMLComplexElement) el;
                    Iterator it = ((XMLComplexElement) tmplEl).toElementMap().entrySet().iterator();
                    while (it.hasNext()) {
                        Map.Entry me = (Map.Entry) it.next();
                        String subElName = (String) me.getKey();
                        XMLElement subEl = (XMLElement) me.getValue();
                        if (!subEl.isEmpty()) {
                            if (!compareToTemplate(topEl, cmplxEl.get(subElName), subEl)) {
                                ret = false;
                                break;
                            }
                        }
                    }
                }
            } else if (el instanceof XMLCollection) {
                if (!tmplEl.toValue().equals("") && !tmplEl.toValue().equals(el.toValue())) {
                    ret = false;
                } else {
                    XMLCollection col = (XMLCollection) el;
                    List cels = ((XMLCollection) tmplEl).toElements();
                    for (int i = 0; i < cels.size(); i++) {
                        XMLElement tcel = (XMLElement) cels.get(i);
                        if (tcel instanceof ActualParameter || tcel instanceof FormalParameter) {
                            if (!compareToTemplate(topEl, col.get(i), tcel)) {
                                ret = false;
                                break;
                            }
                        } else {
                            boolean btt = false;
                            for (int j = 0; j < col.size(); j++) {
                                XMLElement e = (XMLElement) col.get(j);
                                if (compareToTemplate(topEl, e, tcel)) {
                                    btt = true;
                                    break;
                                }
                            }
                            if (!btt) {
                                ret = btt;
                            }
                        }
                    }
                }
            } else if (el instanceof XMLComplexChoice) {
                XMLElement tmplChsn = ((XMLComplexChoice) tmplEl).getChoosen();
                XMLElement elChsn = ((XMLComplexChoice) el).getChoosen();
                ret = compareToTemplate(topEl, elChsn, tmplChsn);
            }
        } else {
            ret = false;
        }
View Full Code Here

    public void enableDisableAction() {
        setEnabled(true);
    }

    public void actionPerformed(ActionEvent e) {
        XMLElement el = ipc.getActiveElement();

        ipc.validateElement(el);

        boolean close = false;
        if (ipc.isModified()) {
View Full Code Here

    public void actionPerformed(ActionEvent e) {
        if (!ipc.canApplyChanges()) {
            return;
        }
        XMLElement el = ipc.getActiveElement();

        jawecomponent.setUpdateInProgress(true);
        JaWEManager.getInstance().getJaWEController().startUndouableChange();
        ipc.apply();
        List toSelect = new ArrayList();
        XMLElement toSel = el;
        if (toSel != null) {
            toSelect.add(toSel);
        }
        JaWEManager.getInstance().getJaWEController().endUndouableChange(toSelect);
        jawecomponent.setUpdateInProgress(false);
View Full Code Here

TOP

Related Classes of org.enhydra.shark.xpdl.XMLElement

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.