Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2016 Goldman Sachs.
*
* 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 com.gs.dmn.signavio;
import com.gs.dmn.DMNModelRepository;
import com.gs.dmn.DRGElementReference;
import com.gs.dmn.runtime.DMNRuntimeException;
import com.gs.dmn.runtime.Pair;
import com.gs.dmn.runtime.interpreter.ImportPath;
import com.gs.dmn.serialization.PrefixNamespaceMappings;
import com.gs.dmn.signavio.extension.MultiInstanceDecisionLogic;
import com.gs.dmn.signavio.extension.SignavioExtension;
import org.apache.commons.lang3.StringUtils;
import org.omg.spec.dmn._20180521.model.*;
import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;
import java.util.*;
import java.util.stream.Collectors;
import static com.gs.dmn.serialization.DMNVersion.DMN_12;
public class SignavioDMNModelRepository extends DMNModelRepository {
private String schemaNamespace = "http://www.signavio.com/schema/dmn/1.1/";
private final String[] schemaPrefixes = new String[] {
"signavio", "sigExt"
};
private QName diagramIdQName = new QName(this.schemaNamespace, "diagramId");
private QName shapeIdQName = new QName(this.schemaNamespace, "shapeId");
public final SignavioExtension extension = new SignavioExtension(this);
private final Map cache = new LinkedHashMap<>();
private final Set iterators = new LinkedHashSet<>();
public SignavioDMNModelRepository() {
this(OBJECT_FACTORY.createTDefinitions(), new PrefixNamespaceMappings());
}
public SignavioDMNModelRepository(TDefinitions definitions, PrefixNamespaceMappings prefixNamespaceMappings) {
this(new Pair<>(definitions, prefixNamespaceMappings));
}
public SignavioDMNModelRepository(Pair pair) {
this(Collections.singletonList(pair));
}
public SignavioDMNModelRepository(List> pairs) {
super(pairs);
populateSignavioCaches(pairs);
}
// Testing only
public SignavioDMNModelRepository(Pair pair, String schemaNamespace) {
this(Collections.singletonList(pair), schemaNamespace);
}
// Testing only
public SignavioDMNModelRepository(List> pairs, String schemaNamespace) {
super(pairs);
this.schemaNamespace = schemaNamespace;
this.diagramIdQName = new QName(schemaNamespace, "diagramId");
this.shapeIdQName = new QName(schemaNamespace, "shapeId");
populateSignavioCaches(pairs);
}
private void populateSignavioCaches(List> pairs) {
for (Pair pair: pairs) {
TDefinitions definitions = pair.getLeft();
// Add DSs
List