Package org.enhydra.shark.xpdl.elements

Examples of org.enhydra.shark.xpdl.elements.WorkflowProcess


      protected ToolRunner (SharkTransaction t,WfActivityInternal wai) throws BaseException {
         this.transaction=t;
         this.activity=wai;
         WfProcessInternal pr=wai.container(t);
         WorkflowProcess wp=SharkUtilities.
            getWorkflowProcess(pr.package_id(t),
                               pr.manager_version(t),
                               pr.process_definition_id(t));
         this.actDef=SharkUtilities.getActivityDefinition(t,wai,wp,wai.block_activity(t));
      }
View Full Code Here


      protected ToolRunner (SharkTransaction t,WfActivityInternal wai) throws BaseException {
         this.transaction=t;
         this.activity=wai;
         WfProcessInternal pr=wai.container(t);
         WorkflowProcess wp=SharkUtilities.
            getWorkflowProcess(pr.package_id(t),
                               pr.manager_version(t),
                               pr.process_definition_id(t));
         this.actDef=SharkUtilities.getActivityDefinition(t,wai,wp,wai.block_activity(t));
      }
View Full Code Here

      protected ToolRunner (SharkTransaction t,WfActivityInternal wai) throws BaseException {
         this.transaction=t;
         this.activity=wai;
         WfProcessInternal pr=wai.container(t);
         WorkflowProcess wp=SharkUtilities.
            getWorkflowProcess(pr.package_id(t),
                               pr.manager_version(t),
                               pr.process_definition_id(t));
         this.actDef=SharkUtilities.getActivityDefinition(t,wai,wp,wai.block_activity(t));
      }
View Full Code Here

        } else if (type.equals(JaWEConstants.ACTIVITY_TYPE_NO)) {
            act.getActivityTypes().setImplementation();
            act.getActivityTypes().getImplementation().getImplementationTypes().setNo();

            // CUSTOM: grab every available workflow variable from the workflow process that it belongs to and add as extended attribute (view only)
            WorkflowProcess process = (WorkflowProcess) act.getParent().getParent();
            Map m = XMLUtil.getPossibleVariables(process);
            XMLCollectionElement dataFields[] = (XMLCollectionElement[]) m.values().toArray(new XMLCollectionElement[0]);
            for (int i = 0; i < dataFields.length; i++) {
                ExtendedAttribute attribute = this.createXPDLObject(act.getExtendedAttributes(), null, true);
                attribute.setName("VariableToProcess_UPDATE");
View Full Code Here

    }

    public WorkflowProcess createXPDLObject(WorkflowProcesses wps,
            String type,
            boolean addToCollection) {
        WorkflowProcess wp = (WorkflowProcess) wps.generateNewElement();
        adjustType(wp, type);

        JaWETypes jts = JaWEManager.getInstance().getJaWEController().getJaWETypes();
        boolean hasTemplate = jts.hasTemplateId(type);
        if (hasTemplate) {
            jts.fillFromTemplate(wp, type);
        }
        String id = wp.getId();

        if (!hasTemplate || id.equals("") || wps.getWorkflowProcess(id) != null) {
            if (id.equals("")) {
                id = JaWEManager.getInstance().getIdFactory().generateUniqueId(wps);
            } else {
                id = JaWEManager.getInstance().getIdFactory().generateSimilarOrIdenticalUniqueId(wps, new HashSet(), id);
            }
            int i = 0;
            while (wps.getWorkflowProcess(id) != null) {
                id = id + String.valueOf(++i);
            }
            wp.setId(id);
        }

        if (!hasTemplate || wp.getName().equals("")) {
            //CUSTOM
            String num = id.substring("process".length());
            wp.setName("Workflow Process " + num);
            //END CUSTOM
        }

        wp.getProcessHeader().setCreated(Utils.getCurrentDateAndTime());
        wp.getProcessHeader().setDurationUnitHOUR();
        wp.getRedefinableHeader().setAuthor(XMLUtil.getPackage(wps).getRedefinableHeader().getAuthor());

        adjustXPDLObject(wp, type);

        if (addToCollection) {
            wps.add(wp);
View Full Code Here

            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);
View Full Code Here

                }
            }
        } else if (el instanceof Package) {
            Iterator it = ((Package) el).getWorkflowProcesses().toElements().iterator();
            while (it.hasNext()) {
                WorkflowProcess wp = (WorkflowProcess) it.next();
                graphsToValidate.addAll(getGraphsToValidate(wp));
            }
        }
        return graphsToValidate;
    }
View Full Code Here

        if (selectedGraph == null) {
            return choices;
        }

        if (cbutton.getChoiceType() == Participant.class) {
            WorkflowProcess wp = selectedGraph.getWorkflowProcess();
            SequencedHashMap choiceMap = XMLUtil.getPossibleParticipants(wp, JaWEManager.getInstance().getXPDLHandler());

            //CUSTOM
            if (!JaWE.BASIC_MODE) {
                choiceMap.put(FreeTextExpressionParticipant.getInstance().getName(), FreeTextExpressionParticipant.getInstance());
            }
            //END CUSTOM

            List toRemove = selectedGraph.getGraphManager().getDisplayedParticipants();

            Iterator it = choiceMap.entrySet().iterator();
            while (it.hasNext()) {
                Map.Entry me = (Map.Entry) it.next();
                if (toRemove.contains(me.getValue())) {
                    it.remove();
                }
            }

            choices.addAll(choiceMap.values());
        } else if (cbutton.getChoiceType() == ActivitySet.class) {
            WorkflowProcess wp = selectedGraph.getWorkflowProcess();
            choices = wp.getActivitySets().toElements();
        }

        return choices;
    }
View Full Code Here

                continue;
            }
            l.addAll(pkg.getWorkflowProcesses().toElements());
            Iterator itWPs = pkg.getWorkflowProcesses().toElements().iterator();
            while (itWPs.hasNext()) {
                WorkflowProcess wp = (WorkflowProcess) itWPs.next();
                l.addAll(wp.getActivitySets().toElements());
            }
        }
        return l;
    }
View Full Code Here

    protected void insertPackage(Package pkg) {
        Iterator it = pkg.getWorkflowProcesses().toElements().iterator();
        boolean isRO = pkg.isReadOnly();
        while (it.hasNext()) {
            WorkflowProcess wp = (WorkflowProcess) it.next();
            createGraph(wp);
            if (settings.performAutomaticLayoutOnInsertion()) {

                if (isRO) {
                    wp.setReadOnly(false);
                }
                SimpleGraphLayout.layoutGraph(this, getGraph(wp));
                if (isRO) {
                    wp.setReadOnly(true);
                }
            }
            Iterator asi = wp.getActivitySets().toElements().iterator();
            while (asi.hasNext()) {
                ActivitySet as = (ActivitySet) asi.next();
                createGraph(as);
                if (settings.performAutomaticLayoutOnInsertion()) {
                    if (isRO) {
                        wp.setReadOnly(false);
                    }
                    SimpleGraphLayout.layoutGraph(this, getGraph(as));
                    if (isRO) {
                        wp.setReadOnly(true);
                    }
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.enhydra.shark.xpdl.elements.WorkflowProcess

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.