public void attemptToFinishActiveJob(String caseID, String taskID) {
    Set workItems = _engineClient.getAllWorkItems();
    for (Iterator iterator = workItems.iterator(); iterator.hasNext(); ) {
      YWorkItem item = (YWorkItem) iterator.next();
      if (item.getCaseID().toString().equals(caseID) && item.getTaskID().equals(taskID)) {
        try {
          String outputData = _myActiveTasks.getOutputData(caseID, taskID);

          /** AJH: Write the output data into test data file */
          File testDataDir = YAdminGUI.getSpecTestDataDirectory(item.getSpecificationID().getKey());
          File taskInputData = new File(testDataDir, taskID + ".xml");
          if (!taskInputData.exists()) {
            logger.info("Creating task data file - " + taskInputData.getAbsolutePath());
            taskInputData.createNewFile();
          }
          StringUtil.stringToFile(taskInputData.getAbsolutePath(), outputData);

          //        _engineClient.completeWorkItem(item, outputData, inSequenceWorkitemIDs);
          _engineClient.completeWorkItem(item, outputData, null, YEngine.WorkItemCompletion.Normal);
        } catch (YDataStateException e) {
          String errors = e.getMessage();
          if (errors.indexOf("FAILED TO VALIDATE AGAINST SCHEMA =") != -1) {
            System.out.println(e.getMessage());
            new SpecificationQueryProcessingValidationErrorBox(_frame, item, e);
          } else {
            new UserInputValidationErrorBox(_frame, item, e);
            System.out.println(e.getMessage());
          }
        } catch (Exception e) {
          // todo AJH - Create defalut skeleton at this point????
          reportGeneralProblem(e);
        }
      }
    }
  }
 private void addStartedWorkItem(YWorkItem item, boolean inSequence) {
   String caseIDStr = item.getCaseID().toString();
   String taskID = item.getTaskID();
   YSpecificationID specificationID = item.getSpecificationID();
   YTask task = _engineClient.getTaskDefinition(specificationID, taskID);
   String taskDescription = task.getDecompositionPrototype().getID();
   if (null == taskDescription) {
     taskDescription = taskID;
   }
   boolean allowsDynamicInstanceCreation = true;
   try {
     _engineClient.checkElegibilityToAddInstances(item.getIDString());
   } catch (YAWLException e) {
     allowsDynamicInstanceCreation = false;
   }
   _myActiveTasks.addRow(
       caseIDStr + taskID,
       new Object[] {
         caseIDStr,
         taskID,
         taskDescription,
         _formatter.format(item.getEnablementTime()),
         _formatter.format(item.getFiringTime()),
         _formatter.format(item.getStartTime()),
         inSequence ? "Y" : "N",
         new Boolean(allowsDynamicInstanceCreation),
         item.getDataString(),
         getOutputSkeletonXML(caseIDStr, taskID)
       });
 }
 public void refreshLists(String userName) {
   // clear the models
   List keys = new ArrayList();
   keys.addAll(_availableWork._rows.keySet());
   for (int i = 0; i < keys.size(); i++) {
     String id = (String) keys.get(i);
     _availableWork.removeRow(id);
   }
   keys.clear();
   keys.addAll(_myActiveTasks._rows.keySet());
   for (int i = 0; i < keys.size(); i++) {
     String id = (String) keys.get(i);
     _myActiveTasks.removeRow(id);
   }
   // now update them
   updateSelf();
   //        _worklistManager.informRemotePartnerOfcurrentState(userName);
 }
 private void addFiredWorkItem(YWorkItem workItem, boolean inSequence) {
   String caseIDStr = workItem.getCaseID().toString();
   String taskID = workItem.getTaskID();
   YSpecificationID specificationID = workItem.getSpecificationID();
   YTask task = _engineClient.getTaskDefinition(specificationID, taskID);
   String taskDescription = task.getDecompositionPrototype().getID();
   if (null == taskDescription) {
     taskDescription = taskID;
   }
   _availableWork.addRow(
       caseIDStr + taskID,
       new Object[] {
         caseIDStr,
         taskID,
         taskDescription,
         "Fired",
         _formatter.format(workItem.getEnablementTime()),
         _formatter.format(workItem.getFiringTime()),
         inSequence ? "Y" : "N"
       });
 }
 private void removeUnstartedWorkItem(String caseIDStr, String taskID) {
   _availableWork.removeRow(caseIDStr + taskID);
 }
 private void removeStartedItem(String caseIDStr, String taskID) {
   _myActiveTasks.removeRow(caseIDStr + taskID);
 }