예제 #1
0
 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)
       });
 }
예제 #2
0
 public boolean allowsDynamicInstanceCreation(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 {
         _engineClient.checkElegibilityToAddInstances(item.getIDString());
         return true;
       } catch (YStateException e) {
         return false;
       }
     }
   }
   return false;
 }