use of io.automatiko.engine.workflow.base.instance.TagInstance in project automatiko-engine by automatiko-io.
the class WorkflowProcessInstanceImpl method evaluateTags.
public Collection<Tag> evaluateTags() {
if (this.tags == null) {
this.tags = new LinkedHashSet<Tag>();
}
Collection<Tag> evaluatedTags = new LinkedHashSet<Tag>();
Collection<TagDefinition> tagDefinitions = ((Process) getProcess()).getTagDefinitions();
for (TagDefinition def : tagDefinitions) {
String tag = def.get(this, getVariables());
if (tag != null) {
Tag tagInstance = new TagInstance(def.getId(), tag);
evaluatedTags.add(tagInstance);
this.tags.remove(tagInstance);
}
}
// append all remaining tasks that didn't have definition - added manually on the instance
evaluatedTags.addAll(this.tags);
// replace existing ones
this.tags = evaluatedTags;
return evaluatedTags;
}
Aggregations