@Override public List<ProcessStateWidget> filterChildren(BpmTask task, List<ProcessStateWidget> sortedList) { String key = task.getProcessInstance().getSimpleAttributeValue(selectorKey); if (key == null) { key = task.getProcessInstance().getRootProcessInstance().getSimpleAttributeValue(selectorKey); } if(key == null){ Map<String, Object> variables = ProcessToolContext.Util.getThreadProcessToolContext().getBpmVariables(task.getProcessInstance()); key = (String) variables.get(selectorKey); } if(key == null) return new ArrayList<ProcessStateWidget>(0); String[] conditionsArray = conditions.split("[,; ]+"); int index = -1; for (int i = 0; i < conditionsArray.length; i++) { if (key.equals(conditionsArray[i].trim())) index = i; } try { return Arrays.asList(sortedList.get(index)); } catch (IndexOutOfBoundsException e) { return new ArrayList<ProcessStateWidget>(0); } } }
@Override public void loadData(BpmTask task) { ProcessInstance pi = task.getProcessInstance().getRootProcessInstance(); if (mode.equalsIgnoreCase(MODE_SMART)) { if (!"true".equalsIgnoreCase(pi.getSimpleAttributeValue("commentAdded", "false"))) { showContent = false; } } bic.removeAllItems(); ProcessComments comments = pi.findAttributeByClass(ProcessComments.class); if (comments != null) { List<ProcessComment> lst = new ArrayList<ProcessComment>(comments.getComments()); Collections.sort(lst, new Comparator<ProcessComment>() { @Override public int compare(ProcessComment o1, ProcessComment o2) { return o2.getCreateTime().compareTo(o1.getCreateTime()); } }); for (int i = 0; i < displayedComments && i < lst.size(); ++i) { bic.addBean(lst.get(i)); } } }
@Override protected void doShowValidationErrorsOrSave(PerformedActionParams params) { if (hasText(askForCommentKey)) { task = params.getSupport().refreshTask(bpmSession, task); if ("true".equals(task.getProcessInstance().getSimpleAttributeValue(askForCommentKey, "false"))) { showAddCommentDialog(params); } else { skipAddingComment = true; super.doShowValidationErrorsOrSave(params); } } else { showAddCommentDialog(params); } }
String processStateConfigurationId = attributesProvider.getProcessInstance().getRootProcessInstance().getSimpleAttributeValue(attributeName);