All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.flowable.dmn.model.DmnDefinition Maven / Gradle / Ivy

/* Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.flowable.dmn.model;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Yvo Swillens
 */
public class DmnDefinition extends NamedElement {

    protected String expressionLanguage;
    protected String typeLanguage;
    protected String namespace;
    protected String exporter;
    protected String exporterVersion;
    protected Map namespaceMap = new LinkedHashMap<>();
    protected List inputData = new ArrayList<>();
    protected List itemDefinitions = new ArrayList<>();
    protected List decisions = new ArrayList<>();
    protected List decisionServices = new ArrayList<>();
    protected Map diDiagrams = new LinkedHashMap<>();
    protected Map locationMap = new LinkedHashMap<>();
    protected Map> locationByDiagramIdMap = new LinkedHashMap<>();
    protected Map labelLocationMap = new LinkedHashMap<>();
    protected Map> labelLocationByDiagramIdMap = new LinkedHashMap<>();
    protected Map> flowLocationMap = new LinkedHashMap<>();
    protected Map>> flowLocationByDiagramIdMap = new LinkedHashMap<>();
    protected Map> decisionServiceDividerLocationMap = new LinkedHashMap<>();
    protected Map>> decisionServiceDividerLocationByDiagramIdMap = new LinkedHashMap<>();

    public String getExpressionLanguage() {
        return expressionLanguage;
    }

    public void setExpressionLanguage(String expressionLanguage) {
        this.expressionLanguage = expressionLanguage;
    }

    public String getTypeLanguage() {
        return typeLanguage;
    }

    public void setTypeLanguage(String typeLanguage) {
        this.typeLanguage = typeLanguage;
    }

    public String getNamespace() {
        return namespace;
    }

    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    public List getInputData() {
        return inputData;
    }
    public void setInputData(List inputData) {
        this.inputData = inputData;
    }
    public void addInputData(InputData inputData) {
        this.inputData.add(inputData);
    }
    public void setItemDefinitions(List itemDefinitions) {
        this.itemDefinitions = itemDefinitions;
    }
    public List getItemDefinitions() {
        return itemDefinitions;
    }

    public void addItemDefinition(ItemDefinition itemDefinition) {
        this.itemDefinitions.add(itemDefinition);
    }

    public List getDecisions() {
        return decisions;
    }

    public void addDecision(Decision decision) {
        this.decisions.add(decision);
    }

    public Decision getDecisionById(String id) {
        for (Decision decision : decisions) {
            if (id.equals(decision.getId())) {
                return decision;
            }
        }
        return null;
    }

    public List getDecisionServices() {
        return decisionServices;
    }

    public void addDecisionService(DecisionService decisionService) {
        this.decisionServices.add(decisionService);
    }

    public DecisionService getDecisionServiceById(String id) {
        for (DecisionService decisionService : decisionServices) {
            if (id.equals((decisionService.getId()))) {
                return decisionService;
            }
        }
        return null;
    }

    public DmnDiDiagram getDiDiagram(String diagramId) {
        return diDiagrams.get(diagramId);
    }

    public Map getDiDiagramMap() {
        return diDiagrams;
    }
    public void addDiDiagram(DmnDiDiagram diDiagram) {
        this.diDiagrams.put(diDiagram.getId(), diDiagram);
    }

    public void addGraphicInfo(String key, GraphicInfo graphicInfo) {
        locationMap.put(key, graphicInfo);
    }

    public void addGraphicInfoByDiagramId(String diagramId, String key, GraphicInfo graphicInfo) {
        locationByDiagramIdMap.computeIfAbsent(diagramId, k -> new LinkedHashMap<>());
        locationByDiagramIdMap.get(diagramId).put(key, graphicInfo);
        locationMap.put(key, graphicInfo);
    }

    public GraphicInfo getGraphicInfo(String key) {
        return locationMap.get(key);
    }

    public GraphicInfo getGraphicInfoByDiagramId(String diagramId, String key) {
        return locationByDiagramIdMap.get(diagramId).get(key);
    }

    public Map getLocationMap() {
        return locationMap;
    }

    public Map> getLocationByDiagramIdMap() {
        return locationByDiagramIdMap;
    }

    public Map getLocationMapByDiagramId(String diagramId) {
        return locationByDiagramIdMap.get(diagramId);
    }

    public void removeLocationByDiagramId(String diagramId) {
        locationByDiagramIdMap.remove(diagramId);
    }

    public List getFlowLocationGraphicInfo(String key) {
        return flowLocationMap.get(key);
    }

    public Map> getFlowLocationMap() {
        return flowLocationMap;
    }

    public Map> getFlowLocationMapByDiagramId(String diagramId) {
        return flowLocationByDiagramIdMap.get(diagramId);
    }

    public Map>> getFlowLocationByDiagramIdMap() {
        return flowLocationByDiagramIdMap;
    }

    public void removeFlowLocationByDiagramId(String diagramId) {
        flowLocationByDiagramIdMap.remove(diagramId);
    }

    public void addFlowGraphicInfoList(String key, List graphicInfoList) {
        flowLocationMap.put(key, graphicInfoList);
    }

    public void addFlowGraphicInfoListByDiagramId(String diagramId, String key, List graphicInfoList) {
        flowLocationByDiagramIdMap.computeIfAbsent(diagramId, k -> new LinkedHashMap<>());
        flowLocationByDiagramIdMap.get(diagramId).put(key, graphicInfoList);
        flowLocationMap.put(key, graphicInfoList);
    }

    public Map> getLabelLocationByDiagramIdMap() {
        return labelLocationByDiagramIdMap;
    }

    public Map getLabelLocationByDiagramId(String diagramId) {
        return labelLocationByDiagramIdMap.get(diagramId);
    }

    public void addLabelGraphicInfo(String key, GraphicInfo graphicInfo) {
        labelLocationMap.put(key, graphicInfo);
    }

    public void addLabelGraphicInfoByDiagramId(String diagramId, String key, GraphicInfo graphicInfo) {
        labelLocationByDiagramIdMap.computeIfAbsent(diagramId, k -> new LinkedHashMap<>());
        labelLocationByDiagramIdMap.get(diagramId).put(key, graphicInfo);
        labelLocationMap.put(key, graphicInfo);
    }

    public void removeLabelGraphicInfo(String key) {
        flowLocationMap.remove(key);
    }

    public Map>> getDecisionServiceDividerLocationByDiagramIdMap() {
        return decisionServiceDividerLocationByDiagramIdMap;
    }

    public Map> getDecisionServiceDividerLocationMapByDiagramId(String diagramId) {
        return decisionServiceDividerLocationByDiagramIdMap.get(diagramId);
    }

    public Map> getDecisionServiceDividerLocationMap() {
        return decisionServiceDividerLocationMap;
    }

    public List getDecisionServiceDividerGraphicInfo(String key) {
        return decisionServiceDividerLocationMap.get(key);
    }

    public void addDecisionServiceDividerGraphicInfoList(String key, List graphicInfoList) {
        decisionServiceDividerLocationMap.put(key, graphicInfoList);
    }

    public void addDecisionServiceDividerGraphicInfoListByDiagramId(String diagramId, String key, List graphicInfoList) {
        decisionServiceDividerLocationByDiagramIdMap.computeIfAbsent(diagramId, k -> new LinkedHashMap<>());
        decisionServiceDividerLocationByDiagramIdMap.get(diagramId).put(key, graphicInfoList);
        decisionServiceDividerLocationMap.put(key, graphicInfoList);
    }

    public String getExporter() {
        return exporter;
    }
    public void setExporter(String exporter) {
        this.exporter = exporter;
    }
    public String getExporterVersion() {
        return exporterVersion;
    }
    public void setExporterVersion(String exporterVersion) {
        this.exporterVersion = exporterVersion;
    }

    public Map getNamespaces() {
        return namespaceMap;
    }

    public void addNamespace(String prefix, String uri) {
        namespaceMap.put(prefix, uri);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy