Package org.enhydra.shark.xpdl

Examples of org.enhydra.shark.xpdl.XMLElement


         int sw = showModifiedWarning();
         if (sw == JOptionPane.CANCEL_OPTION || (sw == JOptionPane.YES_OPTION && isModified()))
            return;
      }
      if (hm.canGoForward()) {
         XMLElement el = hm.getNext(getActiveElement());
         displayElement(el);

         JaWEManager.getInstance().getJaWEController().getSelectionManager().setSelection(el, true);
         getPanelSettings().adjustActions();
      }
View Full Code Here


            act.getActivityTypes().getImplementation().getImplementationTypes().setTools();

            // CUSTOM
            String defaultAppId = "default_application";
            // look for default tool
            XMLElement el = act.getParent();
            while (el.getParent() != null) {
                el = el.getParent();
            }
            Package pkg = (Package) el;
            Applications apps = pkg.getApplications();
            Application defaultApp = apps.getApplication(defaultAppId);
            if (defaultApp == null) {
View Full Code Here

        }

    }

    public XMLElement duplicateXPDLObject(XMLCollection col, XMLElement el) {
        XMLElement dup = col.generateNewElement();
        dup.makeAs(el);
        if (dup instanceof XMLCollectionElement) {
            if (!(dup instanceof Tool)) {
                ((XMLCollectionElement) dup).setId(JaWEManager.getInstance().getIdFactory().generateUniqueId((XMLCollection) dup.getParent()));
            }
            XMLElement name = ((XMLCollectionElement) el).get("Name");
            if (name != null && name.toValue().length() > 0) {
                ((XMLCollectionElement) dup).set("Name",
                        ResourceManager.getLanguageDependentString("CopyOfKey") + " " + name.toValue());
            }
        }
        return dup;
    }
View Full Code Here

        }
        return dup;
    }

    public XMLElement makeIdenticalXPDLObject(XMLCollection col, XMLElement el) {
        XMLElement dup = col.generateNewElement();
        dup.makeAs(el);
        return dup;
    }
View Full Code Here

                        col.remove((XMLElement) lst.get(i));
                    }

                }
            } else if (info.getAction() == XPDLElementChangeInfo.UPDATED) {
                XMLElement el = info.getChangedElement();
                if (el instanceof XMLComplexChoice) {
                    ((XMLComplexChoice) el).setChoosen((XMLElement) info.getNewValue());
                } else {
                    el.setValue(info.getNewValue().toString());
                }
            } else if (info.getAction() == XPDLElementChangeInfo.REPOSITIONED) {
                XMLCollection col = (XMLCollection) info.getChangedElement();
                List lst = info.getChangedSubElements();
                List newPositions = (List) info.getNewValue();
View Full Code Here

                    icon = "error_icon.gif";
                    hasError = true;
                } else if (XMLValidationError.TYPE_WARNING.equals(err.getType())) {
                    hasWarning = true;
                }
                XMLElement element = Utils.getLocation(err.getElement());

                // determine error message
                String errorId = err.getId();
                String error = ResourceManager.getLanguageDependentString(errorId);
                if (error == null) {
                    error = errorId;
                }

                // determine error type, element type and name
                String errorType = ResourceManager.getLanguageDependentString(err.getType() + "TypeKey");
                String elementType = ResourceManager.getLanguageDependentString(element.toName() + "Key");
                String name = "";
                if (element instanceof XMLComplexElement) {
                    XMLElement idEl = (XMLElement) ((XMLComplexElement) element).get("Name");
                    name = (idEl != null) ? idEl.toValue() : "";
                    if (name == null || name.trim().length() == 0) {
                        idEl = (XMLElement) ((XMLComplexElement) element).get("Id");
                        name = (idEl != null) ? idEl.toValue() : "";
                    }
                }

                // compose label message
                String message =
View Full Code Here

    /**
     * Retrieves the workflow element based on the selected row
     * @return
     */
    protected XMLElement getSelectedElement() {
        XMLElement element = null;
        int selected = table.getSelectedRow();
        if (selected >= 0 && errorList.size() > selected) {
            Object el = errorList.get(selected);
            if (el instanceof ValidationError) {
                // get error
View Full Code Here

            // suggest to edit transition properties
            String message = getSuggestionMessage(error, ResourceManager.getLanguageDependentString("GUIDE_WARNING_TRANSITION"));
            int result = JOptionPane.showConfirmDialog(this.getRootPane(), message, ResourceManager.getLanguageDependentString("GUIDE_TITLE"), JOptionPane.YES_NO_OPTION);
            if (result == JOptionPane.YES_OPTION) {
                // show transition dialog
                XMLElement element = getSelectedElement();
                StandardXPDLElementEditor ed = new StandardXPDLElementEditor();
                ed.editXPDLElement(element);
            }

        } else {
View Full Code Here

     * Listener to select the affected element in the graph when an error is selected.
     */
    class CustomListListener implements ListSelectionListener {

        public void valueChanged(ListSelectionEvent lse) {
            XMLElement element = getSelectedElement();
            if (element != null) {
                // select element in graph
                GraphController gc = (GraphController) JaWEManager.getInstance().getComponentManager().getComponent("GraphComponent");
                Graph g = null;
                WorkflowProcess wp = null;
                if (element instanceof Activity) {
                    wp = (WorkflowProcess) element.getParent().getParent();
                    g = gc.getGraph(wp);
                    gc.selectGraphForElement(wp);
                    g.selectActivity((Activity) element, false);
                } else if (element instanceof Transition) {
                    wp = (WorkflowProcess) element.getParent().getParent();
                    g = gc.getGraph(wp);
                    gc.selectGraphForElement(wp);
                    g.selectTransition((Transition) element, false);
                }

View Full Code Here

    public void add(XMLElement el) {
        super.add(el);
        // add editable variable for all existing activities when a variable is added
        XPDLObjectFactory xpdlObjectFactory = JaWEManager.getInstance().getXPDLObjectFactory();
        DataField df = (DataField)el;
        XMLElement parent = getParent();
        if (parent instanceof WorkflowProcess) {
            parent.setNotifyListeners(false);
            parent.setNotifyMainListeners(false);
            WorkflowProcess wp = (WorkflowProcess)parent;
            Activities acts = wp.getActivities();
            for (int i=0; i<acts.size(); i++) {
                Activity act = (Activity)acts.get(i);
                if (act.getActivityType() == XPDLConstants.ACTIVITY_TYPE_NO) {
                    ExtendedAttribute attribute = xpdlObjectFactory.createXPDLObject(act.getExtendedAttributes(), null, true);
                    attribute.setName("VariableToProcess_UPDATE");
                    attribute.setVValue(df.getId());
                }
            }
            parent.setNotifyListeners(true);
            parent.setNotifyMainListeners(true);
        }
    }
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.