use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem in project kie-wb-common by kiegroup.
the class DMNMarshallerImportsClientHelper method updateInformationItem.
private void updateInformationItem(final String namespace, final JSITDRGElement drgElement) {
getInformationItem(drgElement).ifPresent(informationItem -> {
final JSITInformationItem tInformationItem = new JSITInformationItem();
final String typeRef = informationItem.getTypeRef();
if (!isEmpty(typeRef) && !isBuiltInType(typeRef)) {
tInformationItem.setTypeRef(namespace + "." + typeRef);
setInformationItem(drgElement, tInformationItem);
}
});
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem in project kie-wb-common by kiegroup.
the class DMNMarshallerImportsClientHelper method getInformationItem.
private Optional<JSITInformationItem> getInformationItem(final JSITDRGElement drgElement) {
final JSITInformationItem variable;
if (JSITDecision.instanceOf(drgElement)) {
final JSITDecision decision = Js.uncheckedCast(drgElement);
variable = Js.uncheckedCast(decision.getVariable());
} else if (JSITInputData.instanceOf(drgElement)) {
final JSITInputData inputData = Js.uncheckedCast(drgElement);
variable = Js.uncheckedCast(inputData.getVariable());
} else if (JSITInvocable.instanceOf(drgElement)) {
final JSITInvocable invocable = Js.uncheckedCast(drgElement);
variable = Js.uncheckedCast(invocable.getVariable());
} else {
return Optional.empty();
}
return Optional.of(variable);
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem in project kie-wb-common by kiegroup.
the class InformationItemPropertyConverter method wbFromDMN.
public static InformationItem wbFromDMN(final JSITInformationItem dmn) {
if (Objects.isNull(dmn)) {
return null;
}
final Id id = IdPropertyConverter.wbFromDMN(dmn.getId());
final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
final Name name = new Name(dmn.getName());
final QName typeRef = QNamePropertyConverter.wbFromDMN(dmn.getTypeRef());
final InformationItem result = new InformationItem(id, description, name, typeRef);
return result;
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem in project kie-wb-common by kiegroup.
the class InformationItemPropertyConverter method dmnFromWB.
public static JSITInformationItem dmnFromWB(final InformationItem wb) {
if (Objects.isNull(wb)) {
return null;
}
final JSITInformationItem result = new JSITInformationItem();
result.setId(wb.getId().getValue());
final Optional<String> description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(wb.getDescription()));
description.ifPresent(result::setDescription);
result.setName(wb.getName().getValue());
QNamePropertyConverter.setDMNfromWB(wb.getTypeRef(), result::setTypeRef);
return result;
}
use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITInformationItem in project kie-wb-common by kiegroup.
the class InputDataConverter method dmnFromNode.
@Override
public JSITInputData dmnFromNode(final Node<View<InputData>, ?> node, final Consumer<JSITComponentWidths> componentWidthsConsumer) {
final InputData source = (InputData) DefinitionUtils.getElementDefinition(node);
final JSITInputData result = new JSITInputData();
result.setId(source.getId().getValue());
final Optional<String> description = Optional.ofNullable(DescriptionPropertyConverter.dmnFromWB(source.getDescription()));
description.ifPresent(result::setDescription);
result.setName(source.getName().getValue());
final JSITInformationItem variable = InformationItemPrimaryPropertyConverter.dmnFromWB(source.getVariable(), source);
result.setVariable(variable);
DMNExternalLinksToExtensionElements.loadExternalLinksIntoExtensionElements(source, result);
return result;
}
Aggregations