use of org.kie.workbench.common.dmn.api.definition.model.Binding in project kie-wb-common by kiegroup.
the class BindingPropertyConverter method wbFromDMN.
public static Binding wbFromDMN(final JSITBinding dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) {
if (Objects.isNull(dmn)) {
return null;
}
final InformationItem parameter = InformationItemPropertyConverter.wbFromDMN(dmn.getParameter());
Expression expression = null;
final JSITExpression jsiWrapped = dmn.getExpression();
if (Objects.nonNull(jsiWrapped)) {
final JSITExpression jsiExpression = Js.uncheckedCast(JsUtils.getUnwrappedElement(jsiWrapped));
expression = ExpressionPropertyConverter.wbFromDMN(jsiExpression, Js.uncheckedCast(dmn), hasComponentWidthsConsumer);
}
final Binding result = new Binding();
if (Objects.nonNull(parameter)) {
parameter.setParent(result);
}
result.setParameter(parameter);
if (Objects.nonNull(expression)) {
expression.setParent(result);
}
result.setExpression(expression);
return result;
}
Aggregations