Search in sources :

Example 1 with JSITNamedElement

use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITNamedElement in project kie-wb-common by kiegroup.

the class NodeEntry method getName.

public String getName() {
    if (name == null) {
        final String type = dmnElement.getTYPE_NAME();
        switch(type) {
            case JSITBusinessKnowledgeModel.TYPE:
            case JSITDecision.TYPE:
            case JSITDecisionService.TYPE:
            case JSITInputData.TYPE:
            case JSITKnowledgeSource.TYPE:
                final JSITNamedElement drgElement = Js.uncheckedCast(dmnElement);
                name = drgElement.getName();
                break;
            case JSITTextAnnotation.TYPE:
                final JSITTextAnnotation textAnnotation = Js.uncheckedCast(dmnElement);
                name = textAnnotation.getText();
                break;
        }
    }
    return name;
}
Also used : JSITTextAnnotation(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITTextAnnotation) JSITNamedElement(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITNamedElement)

Example 2 with JSITNamedElement

use of org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITNamedElement in project kie-wb-common by kiegroup.

the class InformationItemPrimaryPropertyConverter method getParentName.

private static String getParentName(final Object parent) {
    if (JSITNamedElement.instanceOf(parent)) {
        final JSITNamedElement namedElement = (JSITNamedElement) parent;
        final Optional<String> name = Optional.ofNullable(namedElement.getName());
        return name.orElse(DEFAULT_NAME);
    }
    return DEFAULT_NAME;
}
Also used : JSITNamedElement(org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITNamedElement)

Aggregations

JSITNamedElement (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITNamedElement)2 JSITTextAnnotation (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITTextAnnotation)1