@SuppressWarnings("unchecked") public Condition evaluate(I_EncodeBusinessProcess process, I_Work worker) throws TaskFailedException { try { List<Collection<UUID>> tempListList = (List<Collection<UUID>>) process.getProperty(uuidListListPropName); if (worker.getLogger().isLoggable(Level.FINE)) { worker.getLogger().fine(("Removing first batch in attachment list.")); } int sizeOfList = tempListList.size(); List<Collection<UUID>> uuidListList = null; if (sizeOfList > listListSize) { uuidListList = new ArrayList<Collection<UUID>>(tempListList.subList(0, listListSize)); } else { uuidListList = new ArrayList<Collection<UUID>>(tempListList.subList(0, sizeOfList)); } process.setProperty(this.uuidList2PropName, uuidListList); if (tempListList.removeAll(uuidListList)) { // do nothing } else { worker.getLogger().info("error encountered in removing uuid collection from list"); } return Condition.CONTINUE; } catch (IllegalArgumentException e) { throw new TaskFailedException(e); } catch (InvocationTargetException e) { throw new TaskFailedException(e); } catch (IntrospectionException e) { throw new TaskFailedException(e); } catch (IllegalAccessException e) { throw new TaskFailedException(e); } }
public Condition evaluate(I_EncodeBusinessProcess process, I_Work worker) throws TaskFailedException { try { I_ConfigAceFrame config = (I_ConfigAceFrame) worker.readAttachement(WorkerAttachmentKeys.ACE_FRAME_CONFIG.name()); I_TermFactory tf = Terms.get(); I_ConfigAceFrame workingProfile = (I_ConfigAceFrame) process.getProperty(profilePropName); if (workingProfile == null) { workingProfile = (I_ConfigAceFrame) worker.readAttachement(WorkerAttachmentKeys.ACE_FRAME_CONFIG.name()); } Object conceptObj = process.getProperty(activeConceptPropName); I_GetConceptData concept = AceTaskUtil.getConceptFromObject(conceptObj); List<? extends I_ConceptAttributeTuple> attrTupels = concept.getConceptAttributeTuples( workingProfile.getAllowedStatus(), workingProfile.getViewPositionSetReadOnly(), workingProfile.getPrecedence(), workingProfile.getConflictResolutionStrategy()); I_IntSet pathSet = Terms.get().newIntSet(); ArrayList<UniversalAcePosition> positionList = new ArrayList<UniversalAcePosition>(); for (I_ConceptAttributeTuple t : attrTupels) { positionList.add( new UniversalAcePosition( tf.getUids(t.getPathId()), tf.convertToThickVersion(t.getVersion()))); pathSet.add(t.getPathId()); } ArrayList<String> addressList = new ArrayList<String>(); I_IntList inboxDescTypeList = Terms.get().newIntList(); inboxDescTypeList.add(ArchitectonicAuxiliary.Concept.USER_INBOX.localize().getNid()); for (int pathId : pathSet.getSetValues()) { I_GetConceptData pathConcept = Terms.get().getConcept(pathId); I_DescriptionTuple inboxDesc = pathConcept.getDescTuple(inboxDescTypeList, config); if (inboxDesc == null) { worker.getLogger().info("Cannot find inbox for: " + pathConcept.getInitialText()); worker.getLogger().info(" inboxDescTypeList: " + inboxDescTypeList.getListArray()); for (I_DescriptionVersioned desc : pathConcept.getDescriptions()) { for (I_DescriptionTuple tuple : desc.getTuples()) { worker.getLogger().info(" desc tuple: " + tuple); } } } else { addressList.add(inboxDesc.getText()); } } process.setProperty(addressListPropName, addressList); process.setProperty(positionListPropName, positionList); worker.getLogger().info("Selected status values have these positions: " + positionList); worker.getLogger().info("Got addresses from status values: " + addressList); return Condition.CONTINUE; } catch (IllegalArgumentException e) { throw new TaskFailedException(e); } catch (IllegalAccessException e) { throw new TaskFailedException(e); } catch (InvocationTargetException e) { throw new TaskFailedException(e); } catch (IntrospectionException e) { throw new TaskFailedException(e); } catch (IOException e) { throw new TaskFailedException(e); } catch (TerminologyException e) { throw new TaskFailedException(e); } }