Search in sources :

Example 16 with ItemDefinition

use of org.kie.workbench.common.dmn.api.definition.model.ItemDefinition in project kie-wb-common by kiegroup.

the class ItemDefinitionCreateHandler method appendItemDefinition.

public ItemDefinition appendItemDefinition() {
    final ItemDefinition itemDefinition = new ItemDefinition();
    itemDefinitions().add(itemDefinition);
    return itemDefinition;
}
Also used : ItemDefinition(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition)

Example 17 with ItemDefinition

use of org.kie.workbench.common.dmn.api.definition.model.ItemDefinition in project kie-wb-common by kiegroup.

the class DataTypeUpdateHandler method refreshSubDataType.

void refreshSubDataType(final DataType dataType, final String newType) {
    final ItemDefinition itemDefinition = itemDefinitionStore.get(dataType.getUUID());
    dataTypeManager.from(dataType).withType(newType);
    recordEngine.doUpdate(dataType, itemDefinition);
}
Also used : ItemDefinition(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition)

Example 18 with ItemDefinition

use of org.kie.workbench.common.dmn.api.definition.model.ItemDefinition in project kie-wb-common by kiegroup.

the class ItemDefinitionDestroyHandler method destroy.

public void destroy(final DataType dataType, final boolean notifyPropertiesPanel) {
    final ItemDefinition itemDefinition = findItemDefinition(dataType);
    final String destroyedItemDefinition = itemDefinition.getName().getValue();
    final Optional<ItemDefinition> itemDefinitionParent = findItemDefinitionParent(dataType);
    itemDefinitionParent.ifPresent(parent -> {
        parent.getItemComponent().remove(itemDefinition);
    });
    itemDefinitions().remove(itemDefinition);
    itemDefinitionStore.unIndex(dataType.getUUID());
    if (notifyPropertiesPanel) {
        notifyPropertiesPanel(destroyedItemDefinition);
    }
}
Also used : ItemDefinition(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition)

Example 19 with ItemDefinition

use of org.kie.workbench.common.dmn.api.definition.model.ItemDefinition in project kie-wb-common by kiegroup.

the class DNDDataTypesHandler method cloneDataType.

DataType cloneDataType(final DataType current) {
    final String currentUUID = current.getUUID();
    final ItemDefinition itemDefinition = itemDefinitionStore.get(currentUUID);
    return dataTypeManager.from(itemDefinition).get();
}
Also used : ItemDefinition(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition)

Example 20 with ItemDefinition

use of org.kie.workbench.common.dmn.api.definition.model.ItemDefinition in project kie-wb-common by kiegroup.

the class ItemDefinitionHandlerTest method makeItemDefinition.

private ItemDefinition makeItemDefinition(final String name, final String type, final boolean isImported) {
    final ItemDefinition itemDefinition = new ItemDefinition();
    itemDefinition.setName(new Name(name));
    itemDefinition.setTypeRef(type == null ? null : new QName(NULL_NS_URI, type, DEFAULT_NS_PREFIX));
    itemDefinition.setAllowOnlyVisualChange(isImported);
    return itemDefinition;
}
Also used : QName(org.kie.workbench.common.dmn.api.property.dmn.QName) ItemDefinition(org.kie.workbench.common.dmn.api.definition.model.ItemDefinition) Name(org.kie.workbench.common.dmn.api.property.dmn.Name) QName(org.kie.workbench.common.dmn.api.property.dmn.QName)

Aggregations

ItemDefinition (org.kie.workbench.common.dmn.api.definition.model.ItemDefinition)119 Test (org.junit.Test)86 DataType (org.kie.workbench.common.dmn.client.editors.types.common.DataType)39 QName (org.kie.workbench.common.dmn.api.property.dmn.QName)37 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)36 ArrayList (java.util.ArrayList)18 Definitions (org.kie.workbench.common.dmn.api.definition.model.Definitions)16 UnaryTests (org.kie.workbench.common.dmn.api.definition.model.UnaryTests)9 Description (org.kie.workbench.common.dmn.api.property.dmn.Description)8 DecisionTable (org.kie.workbench.common.dmn.api.definition.model.DecisionTable)7 Id (org.kie.workbench.common.dmn.api.property.dmn.Id)7 JSITItemDefinition (org.kie.workbench.common.dmn.webapp.kogito.marshaller.js.model.dmn12.JSITItemDefinition)7 Text (org.kie.workbench.common.dmn.api.property.dmn.Text)6 DataTypeManager (org.kie.workbench.common.dmn.client.editors.types.common.DataTypeManager)6 QName (javax.xml.namespace.QName)4 Import (org.kie.workbench.common.dmn.api.definition.model.Import)4 InputClause (org.kie.workbench.common.dmn.api.definition.model.InputClause)4 RefreshDataTypesListEvent (org.kie.workbench.common.dmn.client.editors.types.common.events.RefreshDataTypesListEvent)4 DMNGraphUtils (org.kie.workbench.common.dmn.client.graph.DMNGraphUtils)4 PMMLDocumentMetadata (org.kie.workbench.common.dmn.api.editors.included.PMMLDocumentMetadata)3