Package org.enhydra.shark.xpdl.elements

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


    }

    public Participant createXPDLObject(Participants ps,
            String type,
            boolean addToCollection) {
        Participant par = (Participant) ps.generateNewElement();
        adjustType(par, type);

        JaWETypes jts = JaWEManager.getInstance().getJaWEController().getJaWETypes();
        boolean hasTemplate = jts.hasTemplateId(type);
        if (hasTemplate) {
            jts.fillFromTemplate(par, type);
        }
        String id = par.getId();
        if (!hasTemplate || id.equals("") || ps.getParticipant(id) != null) {
            if (id.equals("")) {
                id = JaWEManager.getInstance().getIdFactory().generateUniqueId(ps);
            } else {
                id = JaWEManager.getInstance().getIdFactory().generateSimilarOrIdenticalUniqueId(ps, new HashSet(), id);
            }
            int i = 0;
            while (ps.getParticipant(id) != null) {
                id = id + String.valueOf(++i);
            }
            par.setId(id);
        }

        if (!hasTemplate || par.getName().equals("")) {
            //CUSTOM
            String num = id.substring("participant".length());
            par.setName("Participant " + num);
            //END CUSTOM
        }

        if (type == null || type.equals("")) {
            type = JaWEConstants.PARTICIPANT_TYPE_ROLE;
        }

        if (type.equals(JaWEConstants.PARTICIPANT_TYPE_HUMAN)) {
            par.getParticipantType().setTypeHUMAN();
        } else if (type.equals(JaWEConstants.PARTICIPANT_TYPE_ROLE)) {
            par.getParticipantType().setTypeROLE();
        } else if (type.equals(JaWEConstants.PARTICIPANT_TYPE_ORGANIZATIONAL_UNIT)) {
            par.getParticipantType().setTypeORGANIZATIONAL_UNIT();
        } else if (type.equals(JaWEConstants.PARTICIPANT_TYPE_RESOURCE)) {
            par.getParticipantType().setTypeRESOURCE();
        } else if (type.equals(JaWEConstants.PARTICIPANT_TYPE_RESOURCE_SET)) {
            par.getParticipantType().setTypeRESOURCE_SET();
        } else if (type.equals(JaWEConstants.PARTICIPANT_TYPE_SYSTEM)) {
            par.getParticipantType().setTypeSYSTEM();
        }

        adjustXPDLObject(par, type);

        if (addToCollection) {
View Full Code Here


        int actType = act.getActivityType();
        boolean toolOrNoAct = true;
        if(actType != 1 && actType != 2){
            toolOrNoAct = false;
        }else{
            Participant p = XMLUtil.findParticipant(xmlInterface, XMLUtil.getWorkflowProcess(act), performer);
            String type = p.getParticipantType().getType();
            if(actType == 1 && "SYSTEM".equals(type)){ //activity in system
                XMLValidationError verr = new XMLValidationError("ERROR", "LOGIC", "ERROR_ACTIVITY_CANNOT_PLACE_IN_SYSTEM", "", el);
                existingErrors.add(verr);
            }
        }

        if(!toolOrNoAct && performer.length() > 0)
        {
            XMLValidationError verr = new XMLValidationError("WARNING", "LOGIC", "WARNING_ACTIVITY_CANNOT_HAVE_PERFORMER", "", el);
            existingErrors.add(verr);
        }
        if(toolOrNoAct && properties.getProperty("ValidatePerformerExpressions", "false").equals("true"))
        {
            Participant p = XMLUtil.findParticipant(xmlInterface, XMLUtil.getWorkflowProcess(act), performer);
            if(p == null && performer.length() > 0 && !XMLUtil.canBeExpression(performer, XMLUtil.getWorkflowProcess(act).getAllVariables(), true))
            {
                XMLValidationError verr = new XMLValidationError("WARNING", "LOGIC", "WARNING_PERFORMER_EXPRESSION_POSSIBLY_INVALID", performer, el);
                existingErrors.add(verr);
            }
View Full Code Here

    {
        XMLComplexElement pkgOrWp = XMLUtil.getWorkflowProcess(el);
        if(pkgOrWp == null)
            pkgOrWp = XMLUtil.getPackage(el);
        String rv = el.toValue();
        Participant p;
        if(pkgOrWp instanceof Package)
            p = XMLUtil.findParticipant(xmlInterface, (Package)pkgOrWp, rv);
        else
            p = XMLUtil.findParticipant(xmlInterface, (WorkflowProcess)pkgOrWp, rv);
        if(p == null)
View Full Code Here

        }
        if (getSelectedGraph() == null) {
            return;
        }
        if (cbutton.getChoiceType() == Participant.class) {
            Participant par = (Participant) change;

            setUpdateInProgress(true);
            JaWEManager.getInstance().getJaWEController().startUndouableChange();
            List vo = GraphUtilities.getParticipantVisualOrder(getSelectedGraph().getXPDLObject());
            vo.add(par.getId());
            GraphUtilities.setParticipantVisualOrder(getSelectedGraph().getXPDLObject(), vo);
            getSelectedGraph().getGraphManager().insertParticipantAndArrangeParticipants(par);
            List toSelect = new ArrayList();
            toSelect.add(par);
            JaWEManager.getInstance().getJaWEController().endUndouableChange(toSelect);
View Full Code Here

        if (updateInProgress) {
            return;
        }

        Object[] selectedCells = getSelectedGraph().getSelectionCells();
        Participant par = null;
        List selectedElements = new ArrayList();
        if (selectedCells != null) {
            for (int i = 0; i < selectedCells.length; i++) {
                if (selectedCells[i] instanceof WorkflowElement) {
                    WorkflowElement we = (WorkflowElement) selectedCells[i];
View Full Code Here

        Iterator it = pkgs.iterator();
        while (it.hasNext()) {
            Package pkg = (Package) it.next();
            Iterator itPars = pkg.getParticipants().toElements().iterator();
            while (itPars.hasNext()) {
                Participant par = (Participant) itPars.next();
                String parId = par.getId();
                if (!m.containsKey(parId)) {
                    m.put(parId, par);
                }
            }
        }
View Full Code Here

        menu.show(getGraph(), (int) pPopupPoint.getX(), (int) pPopupPoint.getY());
    }

    public void insertParticipant() {
        graphController.setUpdateInProgress(true);
        Participant toInsert = null;

        //CUSTOM
        Participants pars = null;
        if (JaWE.BASIC_MODE) {
            pars = this.getJaWEController().getSelectionManager().getWorkingPKG().getParticipants();
        } else {
            pars = getGraph().getWorkflowProcess().getParticipants();
        }
        //END CUSTOM

        String idForVO = null;
        boolean insertIntoCollection = false;
        if (GraphEAConstants.PARTICIPANT_TYPE_FREE_TEXT_EXPRESSION.equals(subType)) {
            if (!getGraphManager().isFreeTextExpressionParticipantShown()) {
                toInsert = FreeTextExpressionParticipant.getInstance();
                idForVO = toInsert.getId();
                setSelectionMode();
            } else {
                return;
            }
        } else if (GraphEAConstants.PARTICIPANT_TYPE_COMMON_EXPRESSION.equals(subType)) {
            toInsert = CommonExpressionParticipants.getInstance().generateCommonExpressionParticipant(getGraph().getXPDLObject());
            idForVO = CommonExpressionParticipants.getInstance().getIdForVisualOrderEA(toInsert.getId());
        } else {
            toInsert = JaWEManager.getInstance().getXPDLObjectFactory().createXPDLObject(
                    pars, subType, false);
            idForVO = toInsert.getId();
            insertIntoCollection = true;
        }
        JaWEManager.getInstance().getJaWEController().startUndouableChange();
        if (insertIntoCollection) {
            pars.add(toInsert);
View Full Code Here

TOP

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

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.