Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

DMN15-159/160 Update Namespace URIs in XSD+exampes #30

Merged
merged 1 commit into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<semantic:definitions xmlns:semantic="https://www.omg.org/spec/DMN/20211108/MODEL/" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" xmlns:include1="http://www.trisotech.com/definitions/_5e8e877a-af87-434b-9c36-ed51c8d6b514" xmlns:drools="http://www.drools.org/kie/dmn/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rss="http://purl.org/rss/2.0/" xmlns:trisofeed="http://trisotech.com/feed" xmlns:trisodmn="http://www.trisotech.com/2016/triso/dmn" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:triso="http://www.trisotech.com/2015/triso/modeling" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:feel="https://www.omg.org/spec/DMN/20211108/FEEL/" xmlns:tc="http://www.omg.org/spec/DMN/20160719/testcase" xmlns="http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4" id="_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4" name="Chapter 11 Example" namespace="http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4" exporter="DMN Modeler" exporterVersion="6.2.2.1" triso:logoChoice="None">
<semantic:definitions xmlns:semantic="https://www.omg.org/spec/DMN/20230324/MODEL/" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" xmlns:include1="http://www.trisotech.com/definitions/_5e8e877a-af87-434b-9c36-ed51c8d6b514" xmlns:drools="http://www.drools.org/kie/dmn/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rss="http://purl.org/rss/2.0/" xmlns:trisofeed="http://trisotech.com/feed" xmlns:trisodmn="http://www.trisotech.com/2016/triso/dmn" xmlns:dmndi="https://www.omg.org/spec/DMN/20230324/DMNDI/" xmlns:triso="http://www.trisotech.com/2015/triso/modeling" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:feel="https://www.omg.org/spec/DMN/20230324/FEEL/" xmlns:tc="http://www.omg.org/spec/DMN/20160719/testcase" xmlns="http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4" id="_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4" name="Chapter 11 Example" namespace="http://www.trisotech.com/definitions/_9d01a0c4-f529-4ad8-ad8e-ec5fb5d96ad4" exporter="DMN Modeler" exporterVersion="6.2.2.1" triso:logoChoice="None">
<semantic:description/>
<semantic:extensionElements>
<triso:ProjectCharter>
Expand All @@ -7,7 +7,7 @@
<triso:projectStakeholders/>
</triso:ProjectCharter>
</semantic:extensionElements>
<semantic:import namespace="http://www.trisotech.com/definitions/_5e8e877a-af87-434b-9c36-ed51c8d6b514" name="Financial" triso:fileId="eyJmIjp7InNrdSI6IjU1ZTFkZDA5LTdjYTUtNGUyMC04NzI1LWVlOTI5NzI2OTZkYiIsIm5hbWUiOiJGaW5hbmNpYWwifSwiciI6eyJhcGlrZXkiOiIyOTIwMDNmNjk4NDBlNzEyIn19" triso:fileName="Chapter 11 Example/Financial" importType="https://www.omg.org/spec/DMN/20211108/MODEL/" drools:modelName="Financial"/>
<semantic:import namespace="http://www.trisotech.com/definitions/_5e8e877a-af87-434b-9c36-ed51c8d6b514" name="Financial" triso:fileId="eyJmIjp7InNrdSI6IjU1ZTFkZDA5LTdjYTUtNGUyMC04NzI1LWVlOTI5NzI2OTZkYiIsIm5hbWUiOiJGaW5hbmNpYWwifSwiciI6eyJhcGlrZXkiOiIyOTIwMDNmNjk4NDBlNzEyIn19" triso:fileName="Chapter 11 Example/Financial" importType="https://www.omg.org/spec/DMN/20230324/MODEL/" drools:modelName="Financial"/>
<semantic:itemDefinition isCollection="false" name="tStrategy" label="tStrategy">
<semantic:typeRef>string</semantic:typeRef>
<semantic:allowedValues triso:constraintsType="enumeration">
Expand Down
2 changes: 1 addition & 1 deletion examples/Chapter 11 Example 1 Originations/Financial.dmn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<semantic:definitions xmlns:semantic="https://www.omg.org/spec/DMN/20211108/MODEL/" xmlns:rss="http://purl.org/rss/2.0/" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" xmlns:trisofeed="http://trisotech.com/feed" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:triso="http://www.trisotech.com/2015/triso/modeling" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:feel="https://www.omg.org/spec/DMN/20211108/FEEL/" xmlns:trisodmn="http://www.trisotech.com/2016/triso/dmn" xmlns:tc="http://www.omg.org/spec/DMN/20160719/testcase" xmlns:drools="http://www.drools.org/kie/dmn/1.1" xmlns="http://www.trisotech.com/definitions/_5e8e877a-af87-434b-9c36-ed51c8d6b514" id="_5e8e877a-af87-434b-9c36-ed51c8d6b514" name="Financial" namespace="http://www.trisotech.com/definitions/_5e8e877a-af87-434b-9c36-ed51c8d6b514" exporter="DMN Modeler" exporterVersion="6.2.2.1" triso:logoChoice="None">
<semantic:definitions xmlns:semantic="https://www.omg.org/spec/DMN/20230324/MODEL/" xmlns:rss="http://purl.org/rss/2.0/" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" xmlns:trisofeed="http://trisotech.com/feed" xmlns:dmndi="https://www.omg.org/spec/DMN/20230324/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:triso="http://www.trisotech.com/2015/triso/modeling" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:feel="https://www.omg.org/spec/DMN/20230324/FEEL/" xmlns:trisodmn="http://www.trisotech.com/2016/triso/dmn" xmlns:tc="http://www.omg.org/spec/DMN/20160719/testcase" xmlns:drools="http://www.drools.org/kie/dmn/1.1" xmlns="http://www.trisotech.com/definitions/_5e8e877a-af87-434b-9c36-ed51c8d6b514" id="_5e8e877a-af87-434b-9c36-ed51c8d6b514" name="Financial" namespace="http://www.trisotech.com/definitions/_5e8e877a-af87-434b-9c36-ed51c8d6b514" exporter="DMN Modeler" exporterVersion="6.2.2.1" triso:logoChoice="None">
<semantic:decisionService id="_5e8e877a-af87-434b-9c36-ed51c8d6b514_DS" name="Whole Model Decision Service" triso:dynamicDecisionService="true">
<semantic:variable name="Whole Model Decision Service" id="_7510044d-9f94-4b5a-a172-bb5412031a86" typeRef="Any"/>
</semantic:decisionService>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<semantic:definitions id="_5c8b9296-96cf-4898-bba5-3a2d21d34eed" name="Loan info" namespace="http://www.trisotech.com/definitions/_5c8b9296-96cf-4898-bba5-3a2d21d34eed" exporter="DMN Modeler" exporterVersion="6.2.2.3" xmlns:semantic="https://www.omg.org/spec/DMN/20211108/MODEL/" xmlns="http://www.trisotech.com/definitions/_5c8b9296-96cf-4898-bba5-3a2d21d34eed">
<semantic:definitions id="_5c8b9296-96cf-4898-bba5-3a2d21d34eed" name="Loan info" namespace="http://www.trisotech.com/definitions/_5c8b9296-96cf-4898-bba5-3a2d21d34eed" exporter="DMN Modeler" exporterVersion="6.2.2.3" xmlns:semantic="https://www.omg.org/spec/DMN/20230324/MODEL/" xmlns="http://www.trisotech.com/definitions/_5c8b9296-96cf-4898-bba5-3a2d21d34eed">
<semantic:itemDefinition name="tBorrower" label="tBorrower">
<semantic:itemComponent id="_b7dcc14d-510d-4628-a510-ca774208e501" name="Full Name">
<semantic:typeRef>string</semantic:typeRef>
Expand Down Expand Up @@ -640,7 +640,7 @@
<semantic:inputData href="#_e0cfe605-3068-42a2-946f-c7db3774de1e"/>
<semantic:inputData href="#_d78ee6d5-96ed-43e6-89d2-123e0f388a67"/>
</semantic:decisionService>
<dmndi:DMNDI xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/">
<dmndi:DMNDI xmlns:dmndi="https://www.omg.org/spec/DMN/20230324/DMNDI/">
<dmndi:DMNDiagram id="_0b101bf8-a9c5-4e7c-8763-c8fcb4263a32" name="Page 1">
<di:extension xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/"/>
<dmndi:Size height="1054.996529420125" width="1803.949344176753"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<semantic:definitions id="_736fa164-03d8-429f-8318-4913a548c3a6" name="Recommended Loan Products" namespace="http://www.trisotech.com/definitions/_736fa164-03d8-429f-8318-4913a548c3a6" exporter="DMN Modeler" exporterVersion="6.2.3" xmlns:semantic="https://www.omg.org/spec/DMN/20211108/MODEL/" xmlns:tc="http://www.omg.org/spec/DMN/20160719/testcase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:include1="http://www.trisotech.com/definitions/_5c8b9296-96cf-4898-bba5-3a2d21d34eed" xmlns="http://www.trisotech.com/definitions/_736fa164-03d8-429f-8318-4913a548c3a6">
<semantic:import namespace="http://www.trisotech.com/definitions/_5c8b9296-96cf-4898-bba5-3a2d21d34eed" name="Services" importType="https://www.omg.org/spec/DMN/20211108/MODEL/"/>
<semantic:definitions id="_736fa164-03d8-429f-8318-4913a548c3a6" name="Recommended Loan Products" namespace="http://www.trisotech.com/definitions/_736fa164-03d8-429f-8318-4913a548c3a6" exporter="DMN Modeler" exporterVersion="6.2.3" xmlns:semantic="https://www.omg.org/spec/DMN/20230324/MODEL/" xmlns:tc="http://www.omg.org/spec/DMN/20160719/testcase" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:include1="http://www.trisotech.com/definitions/_5c8b9296-96cf-4898-bba5-3a2d21d34eed" xmlns="http://www.trisotech.com/definitions/_736fa164-03d8-429f-8318-4913a548c3a6">
<semantic:import namespace="http://www.trisotech.com/definitions/_5c8b9296-96cf-4898-bba5-3a2d21d34eed" name="Services" importType="https://www.omg.org/spec/DMN/20230324/MODEL/"/>
<semantic:itemDefinition name="tBorrower" label="tBorrower">
<semantic:itemComponent id="_b7dcc14d-510d-4628-a510-ca774208e501" name="Full Name">
<semantic:typeRef>string</semantic:typeRef>
Expand Down Expand Up @@ -1171,7 +1171,7 @@ and To be paid off=true].Balance[item!=null])</semantic:text>
</semantic:context>
</semantic:encapsulatedLogic>
</semantic:businessKnowledgeModel>
<dmndi:DMNDI xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/">
<dmndi:DMNDI xmlns:dmndi="https://www.omg.org/spec/DMN/20230324/DMNDI/">
<dmndi:DMNDiagram id="_0b101bf8-a9c5-4e7c-8763-c8fcb4263a32" name="Page 1">
<di:extension xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/"/>
<dmndi:Size height="1050" width="1550.4755458831787"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
id="Definitions_DecisionService"
name="Decision Service"
namespace="http://www.omg.org/spec/DMN/20180521/diagram-interchange-decision-service/"
xmlns="https://www.omg.org/spec/DMN/20211108/MODEL/"
xmlns="https://www.omg.org/spec/DMN/20230324/MODEL/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/"
xmlns:dmndi="https://www.omg.org/spec/DMN/20230324/DMNDI/"
xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/">
<decisionService id="DecisionService_1" name="Decision Service 1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
id="Definitions_0v8cooh"
name="Decision with Listed Input data"
namespace="http://www.omg.org/spec/DMN/20180521/diagram-interchange-decision-with-listed-input-data/"
xmlns="https://www.omg.org/spec/DMN/20211108/MODEL/"
xmlns="https://www.omg.org/spec/DMN/20230324/MODEL/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/"
xmlns:dmndi="https://www.omg.org/spec/DMN/20230324/DMNDI/"
xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/">
<decision id="Decision_1" name="Decision">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions id="dish-decisions" name="Dish Decisions"
namespace="http://www.omg.org/spec/DMN/20180521/dish-example/"
xmlns="https://www.omg.org/spec/DMN/20211108/MODEL/"
xmlns="https://www.omg.org/spec/DMN/20230324/MODEL/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/"
xmlns:dmndi="https://www.omg.org/spec/DMN/20230324/DMNDI/"
xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
id="definitions_0v8cooh"
name="Decision"
namespace="http://www.omg.org/spec/DMN/20180521/diagram-interchange-shape-with-label-text/"
xmlns="https://www.omg.org/spec/DMN/20211108/MODEL/"
xmlns="https://www.omg.org/spec/DMN/20230324/MODEL/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/"
xmlns:dmndi="https://www.omg.org/spec/DMN/20230324/DMNDI/"
xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/">
<decision id="Decision_1" name="Decision 1"/>
Expand Down
14 changes: 7 additions & 7 deletions xsd/DMN15.xsd
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema elementFormDefault="qualified"
xmlns="https://www.omg.org/spec/DMN/20211108/MODEL/"
xmlns="https://www.omg.org/spec/DMN/20230324/MODEL/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/"
targetNamespace="https://www.omg.org/spec/DMN/20211108/MODEL/">
xmlns:dmndi="https://www.omg.org/spec/DMN/20230324/DMNDI/"
targetNamespace="https://www.omg.org/spec/DMN/20230324/MODEL/">

<xsd:import namespace="https://www.omg.org/spec/DMN/20191111/DMNDI/"
schemaLocation="DMNDI13.xsd">
<xsd:import namespace="https://www.omg.org/spec/DMN/20230324/DMNDI/"
schemaLocation="DMNDI15.xsd">
<xsd:annotation>
<xsd:documentation>
Include the DMN Diagram Interchange (DI) schema
Expand Down Expand Up @@ -54,8 +54,8 @@
<xsd:element ref="businessContextElement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="dmndi:DMNDI" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="expressionLanguage" type="xsd:anyURI" use="optional" default="https://www.omg.org/spec/DMN/20211108/FEEL/"/>
<xsd:attribute name="typeLanguage" type="xsd:anyURI" use="optional" default="https://www.omg.org/spec/DMN/20211108/FEEL/"/>
<xsd:attribute name="expressionLanguage" type="xsd:anyURI" use="optional" default="https://www.omg.org/spec/DMN/20230324/FEEL/"/>
<xsd:attribute name="typeLanguage" type="xsd:anyURI" use="optional" default="https://www.omg.org/spec/DMN/20230324/FEEL/"/>
<xsd:attribute name="namespace" type="xsd:anyURI" use="required"/>
<xsd:attribute name="exporter" type="xsd:string" use="optional"/>
<xsd:attribute name="exporterVersion" type="xsd:string" use="optional"/>
Expand Down
4 changes: 2 additions & 2 deletions xsd/DMNDI15.xsd
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/"
xmlns:dmndi="https://www.omg.org/spec/DMN/20230324/DMNDI/"
xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/"
targetNamespace="https://www.omg.org/spec/DMN/20191111/DMNDI/"
targetNamespace="https://www.omg.org/spec/DMN/20230324/DMNDI/"
elementFormDefault="qualified" attributeFormDefault="unqualified">

<xsd:import namespace="http://www.omg.org/spec/DMN/20180521/DC/"
Expand Down
5 changes: 4 additions & 1 deletion xsd/dmn-namespace-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ DMN11='http://www.omg.org/spec/DMN/20151101/dmn.xsd'
DMN12='http://www.omg.org/spec/DMN/20180521/MODEL/'
DMN13='https://www.omg.org/spec/DMN/20191111/MODEL/'
DMN14='https://www.omg.org/spec/DMN/20211108/MODEL/'
DMN15='https://www.omg.org/spec/DMN/20230324/MODEL/'
DMNDI11='http://www.omg.org/spec/DMN/20151101/DMNDI'
DMNDI12='http://www.omg.org/spec/DMN/20180521/DMNDI/'
DMNDI13='https://www.omg.org/spec/DMN/20191111/DMNDI/'
DMNDI15='https://www.omg.org/spec/DMN/20230324/DMNDI/'
DI='http://www.omg.org/spec/DMN/20180521/DI/'
DC='http://www.omg.org/spec/DMN/20180521/DC/'
FEEL10='http://www.omg.org/spec/FEEL/20140401'
FEEL12='http://www.omg.org/spec/DMN/20180521/FEEL/'
FEEL13='https://www.omg.org/spec/DMN/20191111/FEEL/'
FEEL14='https://www.omg.org/spec/DMN/20211108/FEEL/'
FEEL14='https://www.omg.org/spec/DMN/20211108/FEEL/'
FEEL15='https://www.omg.org/spec/DMN/20230324/FEEL/'
22 changes: 15 additions & 7 deletions xsd/migrate-to-new-namespaces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ XSD_DIR="$(dirname $0)"

source "$XSD_DIR/dmn-namespace-utils.sh"

find_dmn13_files() {
grep -Hirl $DMN13 --exclude='*.biodi.dmn' --exclude='test-xsd*' --exclude='dmn-namespace-utils.sh' --exclude='migrate-to-new-namespaces.sh' --exclude='DMN13.xsd' --exclude-dir=.git --exclude-dir=target
}
#find_dmn13_files() {
# grep -Hirl $DMN13 --exclude='*.biodi.dmn' --exclude='test-xsd*' --exclude='dmn-namespace-utils.sh' --exclude='migrate-to-new-namespaces.sh' --exclude='DMN13.xsd' --exclude-dir=.git --exclude-dir=target
#}

#find_dmn13_files

Expand All @@ -34,10 +34,18 @@ upgrade_dmn_13_to_dmn_14() {
"$1"
}

# recursively search all DMN files in the current directory and perform a schema validation with the DMN 1.1 and 1.2 schemas
upgrade_dmn_14_to_dmn_15() {
sed \
-e "s#$DMN14#$DMN15#g" \
-e "s#$FEEL14#$FEEL15#g" \
-e "s#$DMNDI13#$DMNDI15#g" \
"$1"
}

# recursively search all DMN files in the current directory and migtrate them
declare -i NUMBER_OF_FILES=0
while IFS= read -r -d '' DMN_FILE; do
NUMBER_OF_FILES+=1
#echo "$NUMBER_OF_FILES: $DMN_FILE"
upgrade_dmn_13_to_dmn_14 "$DMN_FILE" | sponge "$DMN_FILE"
done < <(find . '(' -iname '*.dmn*.xml' -o -iname '*.dmn' ')' -type f -print0)
echo "$NUMBER_OF_FILES: $DMN_FILE"
upgrade_dmn_14_to_dmn_15 "$DMN_FILE" | sponge "$DMN_FILE"
done < <(find . '(' -iname '*.dmn*.xml' -or -iname '*.dmn' -or -name 'DMN*15.xsd' ')' -type f -print0)