use of org.kie.workbench.common.services.datamodeller.core.Annotation in project drools-wb by kiegroup.
the class DecisionTableXLSToDecisionTableGuidedConverter method addAnnotations.
private void addAnnotations(final DataObject dataObject, final List<AnnotationMetaModel> annotationMetaModelList) {
for (AnnotationMetaModel annotationMetaModel : annotationMetaModelList) {
final String name = annotationMetaModel.name;
final Map<String, String> values = annotationMetaModel.values;
Annotation annotation;
String key = DroolsDomainAnnotations.VALUE_PARAM;
String value = "";
if (values.size() > 0) {
key = values.keySet().iterator().next();
value = values.values().iterator().next();
}
if ("Role".equals(name)) {
annotation = new AnnotationImpl(annotationDefinitions.get(DroolsDomainAnnotations.ROLE_ANNOTATION));
annotation.setValue(key, value);
dataObject.addAnnotation(annotation);
} else if ("Position".equals(name)) {
annotation = new AnnotationImpl(annotationDefinitions.get(DroolsDomainAnnotations.POSITION_ANNOTATION));
annotation.setValue(key, value);
dataObject.addAnnotation(annotation);
} else if ("Equals".equals(name)) {
annotation = new AnnotationImpl(annotationDefinitions.get(DroolsDomainAnnotations.KEY_ANNOTATION));
annotation.setValue(key, value);
dataObject.addAnnotation(annotation);
}
}
}
Aggregations