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

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


            }
            if (successful(_sessionHandle)) {
                List executingChildren = checkOutAllInstancesOfThisTask(enabledWorkItem, _sessionHandle);
                String resultsFromService = "";
                for (int i = 0; i < executingChildren.size(); i++) {
                    WorkItemRecord itemRecord = (WorkItemRecord) executingChildren.get(i);

                    Element caseDataBoundForEngine = prepareReplyRootElement(enabledWorkItem, _sessionHandle);

//                    first of all do a connection with the SMS Service
//                    String smsConnectionID = performSMSConnection(_smsUsername, _smsPassword);

                    //next get the parameters for message sending.
                    Element paramsData = itemRecord.getWorkItemData();
                    String message = paramsData.getChildText(SMS_MESSAGE_PARAMNAME);
                    String toPhone = paramsData.getChildText(SMS_PHONENO_PARAMNAME);
//                    String msgCorrelationID = itemRecord.getID().substring(0, 12);

//                    resultsFromService += performSMSSend(message, toPhone, smsConnectionID, msgCorrelationID);
View Full Code Here


        if (result != null && successful(result)) {
            Document doc = builder.build(new StringReader(result));
            Iterator workItemEls = doc.getRootElement().getChildren().iterator();
            while (workItemEls.hasNext()) {
                Element workItemElement = (Element) workItemEls.next();
                WorkItemRecord workItem = Marshaller.unmarshalWorkItem(workItemElement);
                workItems.add(workItem);
            }
        }
        return workItems;
    }
View Full Code Here

            if (result != null && successful(result)) {
                Document doc = builder.build(new StringReader(result));
                Iterator workItemEls = doc.getRootElement().getChildren().iterator();
                while (workItemEls.hasNext()) {
                    Element workItemElement = (Element) workItemEls.next();
                    WorkItemRecord workItem = Marshaller.unmarshalWorkItem(workItemElement);
                    workItems.add(workItem);
                }
            }
        } catch (JDOMException e) {
            e.printStackTrace();
View Full Code Here



    public void doPost(HttpServletRequest request, HttpServletResponse response) {
        String workitemStr = request.getParameter("workitem");
        WorkItemRecord workitem = Marshaller.unmarshalWorkItem(workitemStr);
        _controller.processWorkItem(workitem);
    }
View Full Code Here

     for the specified workitem
      * @param itemID - the id of the item to get the triggers for
     * @return the (String) list of triggers
     */
    public List getExternalTriggersForItem(String itemID) {
        WorkItemRecord wir = getWorkItemRecord(itemID);
        RdrTree tree = getTree(wir.getSpecificationID(), getDecompID(wir),
                               XTYPE_ITEM_EXTERNAL_TRIGGER);
        return getExternalTriggers(tree) ;
    }
View Full Code Here

        synchronized (mutex) {
            _log.info("HANDLE EXTERNAL EXCEPTION EVENT");        // note to log

            String caseID, taskID;
            WorkItemRecord wir = null;
            int xLevel ;

            if (level.equalsIgnoreCase("case")) {                // if case level
                caseID = id;
                taskID = null;
                xLevel = XTYPE_CASE_EXTERNAL_TRIGGER ;
            }
            else {                                               // else item level
                wir = getWorkItemRecord(id);
                caseID = wir.getCaseID();
                taskID = wir.getTaskID();
                xLevel = XTYPE_ITEM_EXTERNAL_TRIGGER ;
            }

            // get case monitor for this case
            CaseMonitor monitor = (CaseMonitor) _monitoredCases.get(caseID);
View Full Code Here

     @return a string of messages decribing the success or otherwise of
     *          the process
     */
     public String replaceWorklet(int xType, String caseid, String itemid, String trigger) {
        String result, workletCaseID ;
        WorkItemRecord wir = null;
        boolean caseLevel = isCaseLevelException(xType);
        CaseMonitor mon = (CaseMonitor) _monitoredCases.get(caseid);

        _log.info("REPLACE EXECUTING WORKLET REQUEST");

        result = "Locating " +
                 (caseLevel? "case '" + caseid : "workitem '" + itemid) +
                "' in the set of currently handled cases...";

        caseid = getIntegralID(caseid);

        // if case is currently being handled
       if (mon != null) {
         result += "found." + Library.newline ;
         _log.debug("Caseid received found in monitoredCases: " + caseid);

            // get the HandlerRunner for the Exception
            HandlerRunner hr = mon.getRunnerForType(xType, itemid) ;

            if (! caseLevel) wir = hr.getItem();

            // get the case ids of the running worklets for this case/workitem
            Iterator witr = hr.getRunningCaseIds().iterator() ;

            while (witr.hasNext()) {
                 workletCaseID = (String) witr.next() ;

                // cancel the worklet running for the case/workitem
              result += "Cancelling running worklet case with case id " + workletCaseID + "...";
              _log.debug("Running worklet case id for this case/item is: " + workletCaseID);
                removeCase(workletCaseID);

                _log.debug("Removing worklet from handlers started: " + workletCaseID);
            _handlersStarted.remove(workletCaseID) ;

                result += "done." + Library.newline ;
            }

            // go through the selection process again
          result += "Launching new replacement worklet case(s) based on revised ruleset...";
          _log.debug("Launching new replacement worklet case(s) based on revised ruleset");

            // refresh ruleset to pickup newly added rule
            RefreshRuleSet(mon.getSpecID());

            // remove monitor's runner for cancelled worklet
            mon.removeHandlerRunner(hr);
            if (_persisting) _dbMgr.persist(hr, DBManager.DB_DELETE);

            // go through the process again, depending on the exception type
            switch (xType) {
               case XTYPE_CASE_PRE_CONSTRAINTS : checkConstraints(mon, true); break;
               case XTYPE_CASE_POST_CONSTRAINTS : checkConstraints(mon, false); break;
               case XTYPE_ITEM_PRE_CONSTRAINTS : checkConstraints(mon, wir, true); break;
               case XTYPE_ITEM_POST_CONSTRAINTS : checkConstraints(mon, wir, false); break;
               case XTYPE_WORKITEM_ABORT : break;   // not yet implemented
               case XTYPE_TIMEOUT :
                       if (wir != null) handleTimeoutEvent(wir, wir.getTaskID()); break ;
               case XTYPE_RESOURCE_UNAVAILABLE : break;   // not yet implemented
               case XTYPE_CONSTRAINT_VIOLATION : break;   // not yet implemented
               case XTYPE_CASE_EXTERNAL_TRIGGER :
                       raiseExternalException("case", caseid, trigger); break;
               case XTYPE_ITEM_EXTERNAL_TRIGGER :
View Full Code Here

        String id = eWIR.getChildText("id");
        String[] idSplit = id.split(":");                      // id = taskid:caseid
        String taskName = Library.getTaskNameFromId(idSplit[0]);

        // call the wir constructor
        WorkItemRecord wir = new WorkItemRecord( idSplit[1], idSplit[0], specID,
                              null, status);

        // add data list if non-parent item
        Element data = eWIR.getChild("data").getChild(taskName) ;
        if (data != null) {
            data = (Element) data.detach() ;
            wir.setDataList(data);
        }
        return wir;
    }
View Full Code Here

            }
        }
        String action = request.getParameter("action");
        String workItemXML = request.getParameter("workItem");
        if ("handleEnabledItem".equals(action)) {
            WorkItemRecord workItem = Marshaller.unmarshalWorkItem(workItemXML);
            _controller.handleEnabledWorkItemEvent(workItem);
        } else if ("cancelWorkItem".equals(action)) {
            WorkItemRecord workItem = Marshaller.unmarshalWorkItem(workItemXML);
            _controller.handleCancelledWorkItemEvent(workItem);
        } else if (InterfaceB_EngineBasedClient.ANNOUNCE_COMPLETE_CASE_CMD.equals(action)) {
            String caseID = request.getParameter("caseID");
            String casedata = request.getParameter("casedata");
            _controller.handleCompleteCaseEvent(caseID, casedata);
View Full Code Here

        Element inputDataEl = null;
        Element outputDataEl = null;
       
        if (workItemID.compareTo("null") != 0) {
          if (theInstanceData != null){
              WorkItemRecord workitem = _worklistController.getCachedWorkItem(workItemID);
             
              inputData = workitem.getDataListString();
              outputData = new String(theInstanceData);
             
              SAXBuilder _builder = new SAXBuilder();
             
              try {
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.