Package au.edu.qut.yawl.elements.state

Examples of au.edu.qut.yawl.elements.state.YIdentifier


        Set itemsToRemove = new HashSet();
        Iterator iter = _idStringToWorkItemsMap.values().iterator();
        while (iter.hasNext()) {
            YWorkItem workitem = (YWorkItem) iter.next();
            if (workitem.getStatus() == YWorkItem.statusEnabled) {
                YIdentifier caseID = workitem.getWorkItemID().getCaseID();
                YNetRunner runner = (YNetRunner) _caseToNetRunnerMap.get(
                        caseID);
                boolean addedOne = false;
                Set enabledTasks = runner.getEnabledTasks();
                for (Iterator iterator = enabledTasks.iterator(); iterator.hasNext();) {
View Full Code Here


        Set itemsToRemove = new HashSet();
        Iterator iter = _idStringToWorkItemsMap.values().iterator();
        while (iter.hasNext()) {
            YWorkItem workitem = (YWorkItem) iter.next();
            if (workitem.getStatus() == YWorkItem.statusFired) {
                YIdentifier caseID = workitem.getWorkItemID().getCaseID();
                YNetRunner runner = (YNetRunner) _caseToNetRunnerMap.get(
                        caseID.getParent());
                boolean addedOne = false;
                if (null != runner) {
                    Set busyTasks = runner.getBusyTasks();
                    for (Iterator iterator = busyTasks.iterator(); iterator.hasNext();) {
                        YTask task = (YTask) iterator.next();
View Full Code Here

        Iterator iter = _idStringToWorkItemsMap.values().iterator();
        while (iter.hasNext()) {
            YWorkItem workitem = (YWorkItem) iter.next();
            if (workitem.getStatus() == YWorkItem.statusExecuting) {
                YIdentifier caseID = workitem.getWorkItemID().getCaseID();
                YNetRunner runner = (YNetRunner)
                        _caseToNetRunnerMap.get(caseID.getParent());
                boolean foundOne = false;
                Set busyTasks = runner.getBusyTasks();
                for (Iterator iterator = busyTasks.iterator(); iterator.hasNext();) {
                    YTask task = (YTask) iterator.next();
                    if (task.getID().equals(workitem.getTaskID())) {
View Full Code Here

        //repository are in synch with the engine
        Iterator iter = _idStringToWorkItemsMap.values().iterator();
        while (iter.hasNext()) {
            YWorkItem workitem = (YWorkItem) iter.next();

            YIdentifier caseID = workitem.getWorkItemID().getCaseID();
            YNetRunner runner;
            if (workitem.getStatus().equals(YWorkItem.statusEnabled) ||
                    workitem.getStatus().equals(YWorkItem.statusIsParent) ||
                    workitem.isEnabledSuspended()) {
                runner = (YNetRunner) _caseToNetRunnerMap.get(caseID);
            } else if (workitem.getStatus().equals(YWorkItem.statusComplete) ||
                    workitem.getStatus().equals(YWorkItem.statusExecuting) ||
                    workitem.getStatus().equals(YWorkItem.statusSuspended) ||
                    workitem.getStatus().equals(YWorkItem.statusFired)) {
                runner = (YNetRunner) _caseToNetRunnerMap.get(caseID.getParent());
            } else {
                continue;
            }
            boolean foundOne = false;
            Set busyTasks = runner.getBusyTasks();
View Full Code Here

            YWorkItem item = (YWorkItem) iterator.next();
            YWorkItemID wid = item.getWorkItemID();

            //get the root id for this work items case
            //and if it matches the cancellation case id then remove it.
            YIdentifier workItemsCaseID = wid.getCaseID();
            while (workItemsCaseID.getParent() != null) {
                workItemsCaseID = workItemsCaseID.getParent();
            }
            //if a work item's root case id matches case passed in save it
            if (workItemsCaseID.toString().equals(caseID.toString())) {
                caseItems.add(item);
            }
        }
        return caseItems ;
    }
View Full Code Here

        try {
            _userList.checkConnection(sessionHandle);
            Set caseIDs = _engine.getCasesForSpecification(specID);
            StringBuffer result = new StringBuffer();
            for (Iterator iterator = caseIDs.iterator(); iterator.hasNext();) {
                YIdentifier caseID = (YIdentifier) iterator.next();
                result.append("<caseID>");
                result.append(caseID.toString());
                result.append("</caseID>");
            }
            return result.toString();
        } catch (YAWLException e) {
            if (e instanceof YPersistenceException) {
View Full Code Here

    }


    public YNetRunner(YPersistenceManager pmgr, YNet netPrototype, Element paramsData) throws YDataStateException, YSchemaBuildingException, YPersistenceException {
//        super("NetRunner:" + netPrototype.getID());
        _caseIDForNet = new YIdentifier();
        /*
        INSERTED FOR PERSISTANCE
        */
//        YPersistance.getInstance().storeData(_caseIDForNet);
        if (pmgr != null) {
View Full Code Here

                                }

                                /***********************/
                            } else {
                                //fire the empty atomic task
                                YIdentifier id = null;
                                try {
                                    id = (YIdentifier) atomicTask.t_fire(pmgr).iterator().next();
                                    atomicTask.t_start(pmgr, id);
                                    completeTask(pmgr, null, atomicTask, id, null);//atomicTask.t_complete(id);
                                } catch (YAWLException e) {
                                    YProblemEvent pe =
                                            new YProblemEvent(atomicTask,
                                                    e.getMessage(),
                                                    YProblemEvent.RuntimeError);
                                    pe.logProblem(pmgr);
                                }
                            }
                        } else {
                            //fire the composite task
                            _busyTasks.add(task);

                            /*************************/
                            /* INSERTED FOR PERSISTANCE*/
                            busyTaskNames.add(task.getID());
//                            YPersistance.getInstance().updateData(this);
                            if (pmgr != null) {
                                pmgr.updateObject(this);
                            }
                            /****************************/

                            Iterator caseIDs = null;
                            try {
                                caseIDs = task.t_fire(pmgr).iterator();
                            } catch (YAWLException e) {
                                e.printStackTrace();
                                YProblemEvent pe =
                                        new YProblemEvent(task,
                                                e.getMessage(),
                                                YProblemEvent.RuntimeError);
                                pe.logProblem(pmgr);
                            }
                            while (caseIDs.hasNext()) {
                                YIdentifier id = (YIdentifier) caseIDs.next();
                                try {
                                    task.t_start(pmgr, id);
                                } catch (YSchemaBuildingException e) {
                                    YProblemEvent f = new YProblemEvent(task,
                                            e.getMessage(),
View Full Code Here

    public List getIdentifiers() {
        List idList = new Vector();
        Set keys = _idToQtyMap.keySet();
        Iterator iter = keys.iterator();
        while (iter.hasNext()) {
            YIdentifier identifier = (YIdentifier) iter.next();
            int amnt = ((Integer) _idToQtyMap.get(identifier)).intValue();
            for (int i = 0; i < amnt; i++) {
                idList.add(identifier);
            }
        }
View Full Code Here


    public void removeAll() {
        Iterator keys = new Vector(_idToQtyMap.keySet()).iterator();
        while (keys.hasNext()) {
            YIdentifier identifier = (YIdentifier) keys.next();
            _idToQtyMap.remove(identifier);
            while (identifier.getLocations().contains(_condition)) {
                identifier.getLocations().remove(_condition);
            }
        }
    }
View Full Code Here

TOP

Related Classes of au.edu.qut.yawl.elements.state.YIdentifier

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.