Package au.edu.qut.yawl.worklist.model

Examples of au.edu.qut.yawl.worklist.model.WorkItemRecord


                for (int i = 0; i < tList.length; i++) {

                    // get workitem record for this task & add it to the monitor's data
                    List wirs = getWorkItemRecordsForTaskInstance(specID, tList[i]);
                    if (wirs != null) {
                        WorkItemRecord wirt = (WorkItemRecord) wirs.get(0);
                        monitor.addProcessInfo(wirt);

                        // get the exception handler for this time out for this task (if any)
                        String taskID = getDecompID(specID, tList[i]);
                        RdrConclusion conc = getExceptionHandler(monitor, taskID, XTYPE_TIMEOUT);
View Full Code Here


    /**
     * Suspends the specified workitem
     * @param hr the HandlerRunner instance with the workitem to suspend
     */
    private boolean suspendWorkItem(HandlerRunner hr) {
        WorkItemRecord wir = hr.getItem();
        ArrayList children = new ArrayList();

        if (wir.hasLiveStatus()) {
            children.add(wir);                          // put item in list for next call
            if (suspendWorkItemList(children)) {        // suspend the item (list)
                hr.setItemSuspended();                  // record the action
                hr.setItem(updateWIR(wir));             // refresh the stored wir
                children.set(0, hr.getItem());          // ... and the list
                hr.setSuspendedList(children);          // record the suspended item
                return true ;
            }
        }
        else
            _log.error("Can't suspend a workitem with a status of " + wir.getStatus());

        return false ;
    }
View Full Code Here

        return false ;
    }

    public boolean suspendWorkItem(String itemID) {
        WorkItemRecord wir = getWorkItemRecord(itemID);
        ArrayList children = new ArrayList();

        if (wir.hasLiveStatus()) {
            children.add(wir);                          // put item in list for next call
            if (suspendWorkItemList(children)) {        // suspend the item (list)
                return true ;
            }
        }
        else
            _log.error("Can't suspend a workitem with a status of " + wir.getStatus());

        return false ;
    }
View Full Code Here

     * Suspends each workitem in the list of items passed
     * @param items - items a list of workitems to suspend
     * @return true if all were successfully suspended
     */
    private boolean suspendWorkItemList(List items) {
        WorkItemRecord item ;
        String itemID = "";

        try {
            Iterator itr = items.iterator();
            while (itr.hasNext()) {
                item = (WorkItemRecord) itr.next();
                itemID = item.getID();
                if (! successful(_interfaceBClient.suspendWorkItem(itemID, _sessionHandle)))
                    throw new IOException() ;
                _log.debug("Successful work item suspend: " + itemID);
            }
        }
View Full Code Here

     *                of that task)
     * @param id - the id of the case/spec/task
     * @return a list of the requested workitems
     */
    private List getListOfExecutingWorkItems(String scope, String id) {
        WorkItemRecord wir;
        List liveItems = getLiveWorkItemsForIdentifier(scope, id) ;
        ArrayList result = new ArrayList();

        Iterator itr = liveItems.iterator();
        while (itr.hasNext()) {
            wir = (WorkItemRecord) itr.next() ;
            if (wir.getStatus().equals(WorkItemRecord.statusExecuting))
                result.add(wir);
        }
        return result ;
    }
View Full Code Here

     *                of that task)
     * @param id - the id of the case/spec/task
     * @return a list of the requested workitems
     */
    private List getListOfSuspendableWorkItems(String scope, String id) {
        WorkItemRecord wir;
        List liveItems = getLiveWorkItemsForIdentifier(scope, id) ;
        ArrayList result = new ArrayList();

        Iterator itr = liveItems.iterator();
        while (itr.hasNext()) {
            wir = (WorkItemRecord) itr.next() ;
            if (wir.hasLiveStatus()) result.add(wir);
        }
        return result ;
    }
View Full Code Here

     * Moves a workitem from 'fired' to executing
     * @param wir - the workitem to unsuspend
     * @return the unsuspended workitem (record)
     */
    private WorkItemRecord unsuspendWorkItem(WorkItemRecord wir) {
        WorkItemRecord result = null ;

        if (wir.getStatus().equals(WorkItemRecord.statusSuspended)) {
            try {
                result = _ixClient.unsuspendWorkItem(wir.getID(), _sessionHandle);
                _log.debug("Successful work item unsuspend: " + wir.getID());
View Full Code Here

        List suspendedItems = runner.getSuspendedList();

        if (suspendedItems != null) {
           Iterator itr = suspendedItems.iterator();
           while (itr.hasNext()) {
               WorkItemRecord wir = (WorkItemRecord) itr.next() ;
               wir = updateWIR(wir);                    // refresh the stored wir
               unsuspendWorkItem(wir);
           }
           _log.debug("Completed unsuspend for all suspended work items");
        }
View Full Code Here

             if (wirs != null){

                 // find out which wirs belong to the specified case/spec/task
                 Iterator itr = wirs.iterator();
                 while (itr.hasNext()) {
                     WorkItemRecord wir = (WorkItemRecord) itr.next() ;
                     if ((idType.equalsIgnoreCase("spec") &&
                          wir.getSpecificationID().equals(id)) ||
                         (idType.equalsIgnoreCase("case") &&
                          wir.getCaseID().equals(id)) ||
                         (idType.equalsIgnoreCase("task") &&
                          wir.getTaskID().equals(id)))
                        result.add(wir);
                 }
             }
         }
         catch (IOException ioe) {
View Full Code Here

        if (items != null) {

            // filter those for this spec
            Iterator itr = items.iterator();
            while (itr.hasNext()) {
                WorkItemRecord wir = (WorkItemRecord) itr.next() ;
                if (! wir.getSpecificationID().equals(specID))
                   items.remove(wir);
            }
        }
        return items;
    }
View Full Code Here

TOP

Related Classes of au.edu.qut.yawl.worklist.model.WorkItemRecord

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.