use of org.eclipse.bpmn2.CategoryValue in project kie-wb-common by kiegroup.
the class LanePropertyWriter method addChild.
@Override
public void addChild(BasePropertyWriter child) {
if (child instanceof DataObjectPropertyWriter) {
final DataObjectReference element = (DataObjectReference) child.getElement();
FlowNode node = new FlowNodeImpl() {
@Override
public Auditing getAuditing() {
return element.getAuditing();
}
@Override
public Monitoring getMonitoring() {
return element.getMonitoring();
}
@Override
public List<CategoryValue> getCategoryValueRef() {
return element.getCategoryValueRef();
}
@Override
public String getName() {
return element.getName();
}
@Override
public String toString() {
return element.toString();
}
};
lane.getFlowNodeRefs().add(node);
} else {
lane.getFlowNodeRefs().add((FlowNode) child.getElement());
}
}
use of org.eclipse.bpmn2.CategoryValue in project kie-wb-common by kiegroup.
the class Bpmn2JsonUnmarshaller method revisitGroups.
public void revisitGroups(Definitions def) {
List<RootElement> rootElements = def.getRootElements();
Category defaultCat = Bpmn2Factory.eINSTANCE.createCategory();
defaultCat.setName("default");
for (RootElement root : rootElements) {
if (root instanceof Process) {
Process process = (Process) root;
List<Artifact> processArtifacts = process.getArtifacts();
if (processArtifacts != null) {
for (Artifact ar : processArtifacts) {
if (ar instanceof Group) {
Group group = (Group) ar;
Iterator<FeatureMap.Entry> iter = group.getAnyAttribute().iterator();
while (iter.hasNext()) {
FeatureMap.Entry entry = iter.next();
if (entry.getEStructuralFeature().getName().equals("categoryval")) {
CategoryValue catval = Bpmn2Factory.eINSTANCE.createCategoryValue();
catval.setValue((String) entry.getValue());
defaultCat.getCategoryValue().add(catval);
group.setCategoryValueRef(catval);
}
}
}
}
}
}
}
// only add category if it includes at least one categoryvalue
if (defaultCat.getCategoryValue() != null && defaultCat.getCategoryValue().size() > 0) {
rootElements.add(defaultCat);
}
}
Aggregations