Squashed 'SpiffWorkflow/' changes from 12f81480a..d27519a36

d27519a36 Merge pull request #259 from sartography/bugfix/spiff-postscript-execution
21aa8a12c update execution order for postscripts
d83fd3d81 Merge pull request #256 from sartography/feature/xml-validation
8303aaab5 uping the sleep time in a test slightly to see if we can get this test to pass consistently in CI.
1d251d55d determine whether to validate by passing in a validator instead of a parameter
2d3daad2d add spiff schema
f8c65dc60 Minor changes to BPMN diagrams to assure all tests are run against valid BPMN Diagrams. Changes required:
9e06b25bf add DMN validation
1b7cbeba0 set parser to validate by default
53fdbba52 add schemas & validation option
a212d9c5d general cleanup

git-subtree-dir: SpiffWorkflow
git-subtree-split: d27519a3631b9772094e5f24dba2f478b0c47135
This commit is contained in:
jasquat 2022-10-27 10:50:48 -04:00
parent 98b76370b1
commit 742f549e98
56 changed files with 4028 additions and 692 deletions

View File

@ -18,8 +18,10 @@
# 02110-1301 USA
import glob
import os
from lxml import etree
from lxml.etree import DocumentInvalid
from SpiffWorkflow.bpmn.specs.events.event_definitions import NoneEventDefinition
@ -37,6 +39,7 @@ from ..specs.ScriptTask import ScriptTask
from ..specs.ServiceTask import ServiceTask
from ..specs.UserTask import UserTask
from .ProcessParser import ProcessParser
from .node_parser import DEFAULT_NSMAP
from .util import full_tag, xpath_eval, first
from .task_parsers import (UserTaskParser, NoneTaskParser, ManualTaskParser,
ExclusiveGatewayParser, ParallelGatewayParser, InclusiveGatewayParser,
@ -47,6 +50,28 @@ from .event_parsers import (StartEventParser, EndEventParser, BoundaryEventParse
SendTaskParser, ReceiveTaskParser)
XSD_PATH = os.path.join(os.path.dirname(__file__), 'schema', 'BPMN20.xsd')
class BpmnValidator:
def __init__(self, xsd_path=XSD_PATH, imports=None):
schema = etree.parse(open(xsd_path))
if imports is not None:
for ns, fn in imports.items():
elem = etree.Element(
'{http://www.w3.org/2001/XMLSchema}import',
namespace=ns,
schemaLocation=fn
)
schema.getroot().insert(0, elem)
self.validator = etree.XMLSchema(schema)
def validate(self, bpmn, filename=None):
try:
self.validator.assertValid(bpmn)
except DocumentInvalid as di:
raise DocumentInvalid(str(di) + "file: " + filename)
class BpmnParser(object):
"""
The BpmnParser class is a pluggable base class that manages the parsing of
@ -83,15 +108,16 @@ class BpmnParser(object):
PROCESS_PARSER_CLASS = ProcessParser
def __init__(self):
def __init__(self, namespaces=None, validator=None):
"""
Constructor.
"""
self.namespaces = namespaces or DEFAULT_NSMAP
self.validator = validator
self.process_parsers = {}
self.process_parsers_by_name = {}
self.collaborations = {}
self.process_dependencies = set()
self.dmn_dependencies = set()
def _get_parser_class(self, tag):
if tag in self.OVERRIDE_PARSER_CLASSES:
@ -146,46 +172,31 @@ class BpmnParser(object):
file
:param filename: Optionally, provide the source filename.
"""
xpath = xpath_eval(bpmn)
# do a check on our bpmn to ensure that no id appears twice
# this *should* be taken care of by our modeler - so this test
# should never fail.
ids = [x for x in xpath('.//bpmn:*[@id]')]
foundids = {}
for node in ids:
id = node.get('id')
if foundids.get(id,None) is not None:
raise ValidationException(
'The bpmn document should have no repeating ids but (%s) repeats'%id,
node=node,
filename=filename)
else:
foundids[id] = 1
if self.validator:
self.validator.validate(bpmn, filename)
for process in xpath('.//bpmn:process'):
self.create_parser(process, xpath, filename)
self._add_processes(bpmn, filename)
self._add_collaborations(bpmn)
self._find_dependencies(xpath)
def _add_processes(self, bpmn, filename=None):
for process in bpmn.xpath('.//bpmn:process', namespaces=self.namespaces):
self._find_dependencies(process)
self.create_parser(process, filename)
collaboration = first(xpath('.//bpmn:collaboration'))
def _add_collaborations(self, bpmn):
collaboration = first(bpmn.xpath('.//bpmn:collaboration', namespaces=self.namespaces))
if collaboration is not None:
collaboration_xpath = xpath_eval(collaboration)
name = collaboration.get('id')
self.collaborations[name] = [ participant.get('processRef') for participant in collaboration_xpath('.//bpmn:participant') ]
def _find_dependencies(self, xpath):
"""Locate all calls to external BPMN and DMN files, and store their
ids in our list of dependencies"""
for call_activity in xpath('.//bpmn:callActivity'):
def _find_dependencies(self, process):
"""Locate all calls to external BPMN, and store their ids in our list of dependencies"""
for call_activity in process.xpath('.//bpmn:callActivity', namespaces=self.namespaces):
self.process_dependencies.add(call_activity.get('calledElement'))
parser_cls, cls = self._get_parser_class(full_tag('businessRuleTask'))
if parser_cls:
for business_rule in xpath('.//bpmn:businessRuleTask'):
self.dmn_dependencies.add(parser_cls.get_decision_ref(business_rule))
def create_parser(self, node, doc_xpath, filename=None, lane=None):
parser = self.PROCESS_PARSER_CLASS(self, node, filename=filename, doc_xpath=doc_xpath, lane=lane)
def create_parser(self, node, filename=None, lane=None):
parser = self.PROCESS_PARSER_CLASS(self, node, self.namespaces, filename=filename, lane=lane)
if parser.get_id() in self.process_parsers:
raise ValidationException('Duplicate process ID', node=node, filename=filename)
if parser.get_name() in self.process_parsers_by_name:
@ -194,14 +205,11 @@ class BpmnParser(object):
self.process_parsers_by_name[parser.get_name()] = parser
def get_dependencies(self):
return self.process_dependencies.union(self.dmn_dependencies)
return self.process_dependencies
def get_process_dependencies(self):
return self.process_dependencies
def get_dmn_dependencies(self):
return self.dmn_dependencies
def get_spec(self, process_id_or_name):
"""
Parses the required subset of the BPMN files, in order to provide an

View File

@ -29,7 +29,7 @@ class ProcessParser(NodeParser):
process.
"""
def __init__(self, p, node, filename=None, doc_xpath=None, lane=None):
def __init__(self, p, node, nsmap, filename=None, lane=None):
"""
Constructor.
@ -39,7 +39,7 @@ class ProcessParser(NodeParser):
:param doc_xpath: an xpath evaluator for the document (optional)
:param lane: the lane of a subprocess (optional)
"""
super().__init__(node, filename, doc_xpath, lane)
super().__init__(node, nsmap, filename=filename, lane=lane)
self.parser = p
self.parsed_nodes = {}
self.lane = lane
@ -58,7 +58,6 @@ class ProcessParser(NodeParser):
can be called by a TaskParser instance, that is owned by this
ProcessParser.
"""
if node.get('id') in self.parsed_nodes:
return self.parsed_nodes[node.get('id')]
@ -66,7 +65,7 @@ class ProcessParser(NodeParser):
if not node_parser or not spec_class:
raise ValidationException("There is no support implemented for this task type.",
node=node, filename=self.filename)
np = node_parser(self, spec_class, node, self.lane)
np = node_parser(self, spec_class, node, lane=self.lane)
task_spec = np.parse_node()
return task_spec
@ -82,12 +81,12 @@ class ProcessParser(NodeParser):
# Check for an IO Specification.
io_spec = first(self.xpath('./bpmn:ioSpecification'))
if io_spec is not None:
data_parser = DataSpecificationParser(io_spec, self.filename, self.doc_xpath)
data_parser = DataSpecificationParser(io_spec, filename=self.filename)
self.spec.data_inputs, self.spec.data_outputs = data_parser.parse_io_spec()
# Get the data objects
for obj in self.xpath('./bpmn:dataObject'):
data_parser = DataSpecificationParser(obj, self.filename, self.doc_xpath)
data_parser = DataSpecificationParser(obj, filename=self.filename)
data_object = data_parser.parse_data_object()
self.spec.data_objects[data_object.name] = data_object

View File

@ -46,7 +46,7 @@ class TaskParser(NodeParser):
outgoing transitions, once the child tasks have all been parsed.
"""
def __init__(self, process_parser, spec_class, node, lane=None):
def __init__(self, process_parser, spec_class, node, nsmap=None, lane=None):
"""
Constructor.
@ -56,7 +56,7 @@ class TaskParser(NodeParser):
extending the TaskParser.
:param node: the XML node for this task
"""
super().__init__(node, process_parser.filename, process_parser.doc_xpath, lane)
super().__init__(node, nsmap, filename=process_parser.filename, lane=lane)
self.process_parser = process_parser
self.spec_class = spec_class
self.spec = self.process_parser.spec

View File

@ -1,30 +1,41 @@
from SpiffWorkflow.bpmn.parser.ValidationException import ValidationException
from .util import xpath_eval, first
from .util import first
DEFAULT_NSMAP = {
'bpmn': 'http://www.omg.org/spec/BPMN/20100524/MODEL',
'bpmndi': 'http://www.omg.org/spec/BPMN/20100524/DI',
'dc': 'http://www.omg.org/spec/DD/20100524/DC',
}
CAMUNDA_MODEL_NS = 'http://camunda.org/schema/1.0/bpmn'
class NodeParser:
def __init__(self, node, filename, doc_xpath, lane=None):
def __init__(self, node, nsmap=None, filename=None, lane=None):
self.node = node
self.nsmap = nsmap or DEFAULT_NSMAP
self.filename = filename
self.doc_xpath = doc_xpath
self.xpath = xpath_eval(node)
self.lane = self._get_lane() or lane
self.position = self._get_position() or {'x': 0.0, 'y': 0.0}
def get_id(self):
return self.node.get('id')
def xpath(self, xpath, extra_ns=None):
return self._xpath(self.node, xpath, extra_ns)
def doc_xpath(self, xpath, extra_ns=None):
root = self.node.getroottree().getroot()
return self._xpath(root, xpath, extra_ns)
def parse_condition(self, sequence_flow):
xpath = xpath_eval(sequence_flow)
expression = first(xpath('.//bpmn:conditionExpression'))
expression = first(self._xpath(sequence_flow, './/bpmn:conditionExpression'))
return expression.text if expression is not None else None
def parse_documentation(self, sequence_flow=None):
xpath = xpath_eval(sequence_flow) if sequence_flow is not None else self.xpath
documentation_node = first(xpath('.//bpmn:documentation'))
documentation_node = first(self._xpath(sequence_flow or self.node, './/bpmn:documentation'))
return None if documentation_node is None else documentation_node.text
def parse_incoming_data_references(self):
@ -50,8 +61,7 @@ class NodeParser:
def parse_extensions(self, node=None):
extensions = {}
extra_ns = {'camunda': CAMUNDA_MODEL_NS}
xpath = xpath_eval(self.node, extra_ns) if node is None else xpath_eval(node, extra_ns)
extension_nodes = xpath( './/bpmn:extensionElements/camunda:properties/camunda:property')
extension_nodes = self.xpath('.//bpmn:extensionElements/camunda:properties/camunda:property', extra_ns)
for node in extension_nodes:
extensions[node.get('name')] = node.get('value')
return extensions
@ -65,3 +75,11 @@ class NodeParser:
bounds = first(self.doc_xpath(f".//bpmndi:BPMNShape[@bpmnElement='{self.get_id()}']//dc:Bounds"))
if bounds is not None:
return {'x': float(bounds.get('x', 0)), 'y': float(bounds.get('y', 0))}
def _xpath(self, node, xpath, extra_ns=None):
if extra_ns is not None:
nsmap = self.nsmap.copy()
nsmap.update(extra_ns)
else:
nsmap = self.nsmap
return node.xpath(xpath, namespaces=nsmap)

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" targetNamespace="http://www.omg.org/spec/BPMN/20100524/MODEL">
<xsd:import namespace="http://www.omg.org/spec/BPMN/20100524/DI" schemaLocation="BPMNDI.xsd"/>
<xsd:include schemaLocation="Semantic.xsd"/>
<xsd:element name="definitions" type="tDefinitions"/>
<xsd:complexType name="tDefinitions">
<xsd:sequence>
<xsd:element ref="import" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="rootElement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="bpmndi:BPMNDiagram" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="relationship" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID" use="optional"/>
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="targetNamespace" type="xsd:anyURI" use="required"/>
<xsd:attribute name="expressionLanguage" type="xsd:anyURI" use="optional" default="http://www.w3.org/1999/XPath"/>
<xsd:attribute name="typeLanguage" type="xsd:anyURI" use="optional" default="http://www.w3.org/2001/XMLSchema"/>
<xsd:attribute name="exporter" type="xsd:string"/>
<xsd:attribute name="exporterVersion" type="xsd:string"/>
<xsd:anyAttribute namespace="##other" processContents="lax"/>
</xsd:complexType>
<xsd:element name="import" type="tImport"/>
<xsd:complexType name="tImport">
<xsd:attribute name="namespace" type="xsd:anyURI" use="required"/>
<xsd:attribute name="location" type="xsd:string" use="required"/>
<xsd:attribute name="importType" type="xsd:anyURI" use="required"/>
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" targetNamespace="http://www.omg.org/spec/BPMN/20100524/DI" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:import namespace="http://www.omg.org/spec/DD/20100524/DC" schemaLocation="DC.xsd" />
<xsd:import namespace="http://www.omg.org/spec/DD/20100524/DI" schemaLocation="DI.xsd" />
<xsd:element name="BPMNDiagram" type="bpmndi:BPMNDiagram" />
<xsd:element name="BPMNPlane" type="bpmndi:BPMNPlane" />
<xsd:element name="BPMNLabelStyle" type="bpmndi:BPMNLabelStyle" />
<xsd:element name="BPMNShape" type="bpmndi:BPMNShape" substitutionGroup="di:DiagramElement" />
<xsd:element name="BPMNLabel" type="bpmndi:BPMNLabel" />
<xsd:element name="BPMNEdge" type="bpmndi:BPMNEdge" substitutionGroup="di:DiagramElement" />
<xsd:complexType name="BPMNDiagram">
<xsd:complexContent>
<xsd:extension base="di:Diagram">
<xsd:sequence>
<xsd:element ref="bpmndi:BPMNPlane" />
<xsd:element ref="bpmndi:BPMNLabelStyle" maxOccurs="unbounded" minOccurs="0" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="BPMNPlane">
<xsd:complexContent>
<xsd:extension base="di:Plane">
<xsd:attribute name="bpmnElement" type="xsd:QName" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="BPMNEdge">
<xsd:complexContent>
<xsd:extension base="di:LabeledEdge">
<xsd:sequence>
<xsd:element ref="bpmndi:BPMNLabel" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="bpmnElement" type="xsd:QName" />
<xsd:attribute name="sourceElement" type="xsd:QName" />
<xsd:attribute name="targetElement" type="xsd:QName" />
<xsd:attribute name="messageVisibleKind" type="bpmndi:MessageVisibleKind" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="BPMNShape">
<xsd:complexContent>
<xsd:extension base="di:LabeledShape">
<xsd:sequence>
<xsd:element ref="bpmndi:BPMNLabel" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="bpmnElement" type="xsd:QName" />
<xsd:attribute name="isHorizontal" type="xsd:boolean" />
<xsd:attribute name="isExpanded" type="xsd:boolean" />
<xsd:attribute name="isMarkerVisible" type="xsd:boolean" />
<xsd:attribute name="isMessageVisible" type="xsd:boolean" />
<xsd:attribute name="participantBandKind" type="bpmndi:ParticipantBandKind" />
<xsd:attribute name="choreographyActivityShape" type="xsd:QName"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="BPMNLabel">
<xsd:complexContent>
<xsd:extension base="di:Label">
<xsd:attribute name="labelStyle" type="xsd:QName" />
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="BPMNLabelStyle">
<xsd:complexContent>
<xsd:extension base="di:Style">
<xsd:sequence>
<xsd:element ref="dc:Font" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:simpleType name="ParticipantBandKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="top_initiating" />
<xsd:enumeration value="middle_initiating" />
<xsd:enumeration value="bottom_initiating" />
<xsd:enumeration value="top_non_initiating" />
<xsd:enumeration value="middle_non_initiating" />
<xsd:enumeration value="bottom_non_initiating" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="MessageVisibleKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="initiating" />
<xsd:enumeration value="non_initiating" />
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" targetNamespace="http://www.omg.org/spec/DD/20100524/DC" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:element name="Font" type="dc:Font"/>
<xsd:element name="Point" type="dc:Point"/>
<xsd:element name="Bounds" type="dc:Bounds"/>
<xsd:complexType name="Font">
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="size" type="xsd:double"/>
<xsd:attribute name="isBold" type="xsd:boolean"/>
<xsd:attribute name="isItalic" type="xsd:boolean"/>
<xsd:attribute name="isUnderline" type="xsd:boolean"/>
<xsd:attribute name="isStrikeThrough" type="xsd:boolean"/>
</xsd:complexType>
<xsd:complexType name="Point">
<xsd:attribute name="x" type="xsd:double" use="required"/>
<xsd:attribute name="y" type="xsd:double" use="required"/>
</xsd:complexType>
<xsd:complexType name="Bounds">
<xsd:attribute name="x" type="xsd:double" use="required"/>
<xsd:attribute name="y" type="xsd:double" use="required"/>
<xsd:attribute name="width" type="xsd:double" use="required"/>
<xsd:attribute name="height" type="xsd:double" use="required"/>
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" targetNamespace="http://www.omg.org/spec/DD/20100524/DI" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:import namespace="http://www.omg.org/spec/DD/20100524/DC" schemaLocation="DC.xsd" />
<xsd:element name="DiagramElement" type="di:DiagramElement" />
<xsd:element name="Diagram" type="di:Diagram" />
<xsd:element name="Style" type="di:Style" />
<xsd:element name="Node" type="di:Node" />
<xsd:element name="Edge" type="di:Edge" />
<xsd:element name="Shape" type="di:Shape" />
<xsd:element name="Plane" type="di:Plane" />
<xsd:element name="LabeledEdge" type="di:LabeledEdge" />
<xsd:element name="Label" type="di:Label" />
<xsd:element name="LabeledShape" type="di:LabeledShape" />
<xsd:complexType abstract="true" name="DiagramElement">
<xsd:sequence>
<xsd:element name="extension" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID" />
<xsd:anyAttribute namespace="##other" processContents="lax" />
</xsd:complexType>
<xsd:complexType abstract="true" name="Diagram">
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="documentation" type="xsd:string" />
<xsd:attribute name="resolution" type="xsd:double" />
<xsd:attribute name="id" type="xsd:ID" />
</xsd:complexType>
<xsd:complexType abstract="true" name="Node">
<xsd:complexContent>
<xsd:extension base="di:DiagramElement" />
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType abstract="true" name="Edge">
<xsd:complexContent>
<xsd:extension base="di:DiagramElement">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="2" name="waypoint" type="dc:Point" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType abstract="true" name="LabeledEdge">
<xsd:complexContent>
<xsd:extension base="di:Edge" />
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType abstract="true" name="Shape">
<xsd:complexContent>
<xsd:extension base="di:Node">
<xsd:sequence>
<xsd:element ref="dc:Bounds" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType abstract="true" name="LabeledShape">
<xsd:complexContent>
<xsd:extension base="di:Shape" />
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType abstract="true" name="Label">
<xsd:complexContent>
<xsd:extension base="di:Node">
<xsd:sequence>
<xsd:element ref="dc:Bounds" minOccurs="0" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType abstract="true" name="Plane">
<xsd:complexContent>
<xsd:extension base="di:Node">
<xsd:sequence>
<xsd:element ref="di:DiagramElement" maxOccurs="unbounded" minOccurs="0" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType abstract="true" name="Style">
<xsd:attribute name="id" type="xsd:ID" />
</xsd:complexType>
</xsd:schema>

File diff suppressed because it is too large Load Diff

View File

@ -138,7 +138,6 @@ class SubprocessParser:
task_parser.process_parser.parser.create_parser(
task_parser.node,
doc_xpath=task_parser.doc_xpath,
filename=task_parser.filename,
lane=task_parser.lane
)

View File

@ -1,10 +1,10 @@
from ..specs.UserTask import UserTask
from ..parser.UserTaskParser import UserTaskParser
from ..parser.task_spec import UserTaskParser
from ...bpmn.parser.BpmnParser import full_tag
from SpiffWorkflow.dmn.parser.BpmnDmnParser import BpmnDmnParser
from SpiffWorkflow.dmn.specs.BusinessRuleTask import BusinessRuleTask
from SpiffWorkflow.camunda.parser.business_rule_task import BusinessRuleTaskParser
from SpiffWorkflow.camunda.parser.task_spec import BusinessRuleTaskParser
from SpiffWorkflow.bpmn.specs.events import EndEvent, IntermediateThrowEvent, StartEvent, IntermediateCatchEvent, BoundaryEvent
from .event_parsers import CamundaStartEventParser, CamundaEndEventParser, \

View File

@ -1,38 +0,0 @@
from SpiffWorkflow.bpmn.parser.util import xpath_eval
from SpiffWorkflow.bpmn.parser.TaskParser import TaskParser
from SpiffWorkflow.dmn.specs.BusinessRuleTask import BusinessRuleTask
CAMUNDA_MODEL_NS = 'http://camunda.org/schema/1.0/bpmn'
class BusinessRuleTaskParser(TaskParser):
dmn_debug = None
def __init__(self, process_parser, spec_class, node, lane=None):
super(BusinessRuleTaskParser, self).__init__(process_parser, spec_class, node, lane)
self.xpath = xpath_eval(self.node, extra_ns={'camunda': CAMUNDA_MODEL_NS})
def create_task(self):
decision_ref = self.get_decision_ref(self.node)
return BusinessRuleTask(self.spec, self.get_task_spec_name(),
dmnEngine=self.process_parser.parser.get_engine(decision_ref, self.node),
lane=self.lane, position=self.position,
description=self.node.get('name', None),
)
@staticmethod
def get_decision_ref(node):
return node.attrib['{' + CAMUNDA_MODEL_NS + '}decisionRef']
def _on_trigger(self, my_task):
pass
def serialize(self, serializer, **kwargs):
pass
@classmethod
def deserialize(cls, serializer, wf_spec, s_state, **kwargs):
pass

View File

@ -1,18 +1,54 @@
from ...bpmn.parser.TaskParser import TaskParser
from ...bpmn.parser.util import xpath_eval
from ...camunda.specs.UserTask import Form, FormField, EnumFormField
from SpiffWorkflow.bpmn.parser.TaskParser import TaskParser
from SpiffWorkflow.bpmn.parser.node_parser import DEFAULT_NSMAP
from SpiffWorkflow.dmn.specs.BusinessRuleTask import BusinessRuleTask
CAMUNDA_MODEL_NS = 'http://camunda.org/schema/1.0/bpmn'
class BusinessRuleTaskParser(TaskParser):
dmn_debug = None
def __init__(self, process_parser, spec_class, node, lane=None):
nsmap = DEFAULT_NSMAP.copy()
nsmap.update({'camunda': CAMUNDA_MODEL_NS})
super(BusinessRuleTaskParser, self).__init__(process_parser, spec_class, node, nsmap, lane)
def create_task(self):
decision_ref = self.get_decision_ref(self.node)
return BusinessRuleTask(self.spec, self.get_task_spec_name(),
dmnEngine=self.process_parser.parser.get_engine(decision_ref, self.node),
lane=self.lane, position=self.position,
description=self.node.get('name', None),
)
@staticmethod
def get_decision_ref(node):
return node.attrib['{' + CAMUNDA_MODEL_NS + '}decisionRef']
def _on_trigger(self, my_task):
pass
def serialize(self, serializer, **kwargs):
pass
@classmethod
def deserialize(cls, serializer, wf_spec, s_state, **kwargs):
pass
class UserTaskParser(TaskParser):
"""
Base class for parsing User Tasks
"""
def __init__(self, process_parser, spec_class, node, lane=None):
super(UserTaskParser, self).__init__(process_parser, spec_class, node, lane)
self.xpath = xpath_eval(node, extra_ns={'camunda': CAMUNDA_MODEL_NS})
nsmap = DEFAULT_NSMAP.copy()
nsmap.update({'camunda': CAMUNDA_MODEL_NS})
super(UserTaskParser, self).__init__(process_parser, spec_class, node, nsmap, lane)
def create_task(self):
form = self.get_form()

View File

@ -1,19 +1,31 @@
import glob
import os
from ...bpmn.parser.util import xpath_eval
from lxml import etree
from ...bpmn.parser.util import full_tag
from ...bpmn.parser.ValidationException import ValidationException
from ...bpmn.parser.BpmnParser import BpmnParser
from ...dmn.parser.DMNParser import DMNParser
from ...bpmn.parser.BpmnParser import BpmnParser, BpmnValidator
from ...dmn.parser.DMNParser import DMNParser, get_dmn_ns
from ..engine.DMNEngine import DMNEngine
from lxml import etree
XSD_DIR = os.path.join(os.path.dirname(__file__), 'schema')
SCHEMAS = {
'http://www.omg.org/spec/DMN/20151101/dmn.xsd': os.path.join(XSD_DIR, 'DMN.xsd'),
'http://www.omg.org/spec/DMN/20180521/MODEL/': os.path.join(XSD_DIR, 'DMN12.xsd'),
'https://www.omg.org/spec/DMN/20191111/MODEL/': os.path.join(XSD_DIR, 'DMN13.xsd'),
}
class BpmnDmnParser(BpmnParser):
def __init__(self):
super().__init__()
def __init__(self, namespaces=None, validator=None, dmn_schemas=None):
super().__init__(namespaces, validator)
self.dmn_schemas = dmn_schemas or SCHEMAS
self.dmn_parsers = {}
self.dmn_parsers_by_name = {}
self.dmn_dependencies = set()
def get_engine(self, decision_ref, node):
if decision_ref not in self.dmn_parsers:
@ -24,15 +36,23 @@ class BpmnDmnParser(BpmnParser):
dmn_parser = self.dmn_parsers[decision_ref]
dmn_parser.parse()
decision = dmn_parser.decision
return DMNEngine(decision.decisionTables[0])
def add_dmn_xml(self, node, filename=None):
"""
Add the given lxml representation of the DMN file to the parser's set.
"""
xpath = xpath_eval(node)
dmn_parser = DMNParser(
self, node, filename=filename, doc_xpath=xpath)
nsmap = get_dmn_ns(node)
# We have to create a dmn validator on the fly, because we support multiple versions
# If we have a bpmn validator, assume DMN validation should be done as well.
# I don't like this, but I don't see a better solution.
schema = self.dmn_schemas.get(nsmap.get('dmn'))
if self.validator and schema is not None:
validator = BpmnValidator(schema)
validator.validate(node, filename)
dmn_parser = DMNParser(self, node, nsmap, filename=filename)
self.dmn_parsers[dmn_parser.get_id()] = dmn_parser
self.dmn_parsers_by_name[dmn_parser.get_name()] = dmn_parser
@ -59,3 +79,16 @@ class BpmnDmnParser(BpmnParser):
self.add_dmn_xml(etree.parse(f).getroot(), filename=filename)
finally:
f.close()
def get_dependencies(self):
return self.process_dependencies.union(self.dmn_dependencies)
def get_dmn_dependencies(self):
return self.dmn_dependencies
def _find_dependencies(self, process):
super()._find_dependencies(process)
parser_cls, cls = self._get_parser_class(full_tag('businessRuleTask'))
for business_rule in process.xpath('.//bpmn:businessRuleTask',namespaces=self.namespaces):
self.dmn_dependencies.add(parser_cls.get_decision_ref(business_rule))

View File

@ -1,25 +1,28 @@
import ast
from SpiffWorkflow.bpmn.parser.node_parser import NodeParser, DEFAULT_NSMAP
from ...bpmn.parser.util import xpath_eval
from ...dmn.specs.model import Decision, DecisionTable, InputEntry, \
OutputEntry, Input, Output, Rule
def get_dmn_ns(node):
"""
Returns the namespace definition for the current DMN
:param node: the XML node for the DMN document
"""
nsmap = DEFAULT_NSMAP.copy()
if 'http://www.omg.org/spec/DMN/20151101/dmn.xsd' in node.nsmap.values():
return 'http://www.omg.org/spec/DMN/20151101/dmn.xsd'
nsmap['dmn'] = 'http://www.omg.org/spec/DMN/20151101/dmn.xsd'
elif 'http://www.omg.org/spec/DMN/20180521/DI/' in node.nsmap.values():
nsmap['dmn'] = 'http://www.omg.org/spec/DMN/20180521/DI/'
elif 'https://www.omg.org/spec/DMN/20191111/MODEL/' in node.nsmap.values():
return 'https://www.omg.org/spec/DMN/20191111/MODEL/'
return None
nsmap['dmn'] = 'https://www.omg.org/spec/DMN/20191111/MODEL/'
return nsmap
class DMNParser(object):
class DMNParser(NodeParser):
"""
Please note this DMN Parser still needs a lot of work. A few key areas
that need to be addressed:
@ -30,7 +33,7 @@ class DMNParser(object):
DT_FORMAT = '%Y-%m-%dT%H:%M:%S'
def __init__(self, p, node, svg=None, filename=None, doc_xpath=None):
def __init__(self, p, node, nsmap, svg=None, filename=None):
"""
Constructor.
@ -40,14 +43,13 @@ class DMNParser(object):
(optional)
:param filename: the source BMN filename (optional)
"""
super().__init__(node, nsmap, filename=filename)
self.parser = p
self.node = node
self.decision = None
self.svg = svg
self.filename = filename
self.doc_xpath = doc_xpath
self.dmn_ns = get_dmn_ns(self.node)
self.xpath = xpath_eval(self.node, {'dmn': self.dmn_ns})
def parse(self):
self.decision = self._parse_decision(self.node.findall('{*}decision'))
@ -117,11 +119,12 @@ class DMNParser(object):
def _parse_input(self, input_element):
type_ref = None
xpath = xpath_eval(input_element, {'dmn': self.dmn_ns})
prefix = self.nsmap['dmn']
xpath = xpath_eval(input_element, {'dmn': prefix})
expression = None
for input_expression in xpath('dmn:inputExpression'):
type_ref = input_expression.attrib.get('typeRef', '')
expression_node = input_expression.find('{' + self.dmn_ns + '}text')
expression_node = input_expression.find('{' + prefix + '}text')
if expression_node is not None:
expression = expression_node.text

View File

@ -0,0 +1,159 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
targetNamespace="http://www.omg.org/spec/DMN/20180521/DC/"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xsd:element name="Color" type="dc:Color"/>
<xsd:element name="Point" type="dc:Point"/>
<xsd:element name="Bounds" type="dc:Bounds"/>
<xsd:element name="Dimension" type="dc:Dimension"/>
<xsd:complexType name="Color">
<xsd:annotation>
<xsd:documentation>Color is a data type that represents a color value in the RGB format.</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="red" type="dc:rgb" use="required"/>
<xsd:attribute name="green" type="dc:rgb" use="required"/>
<xsd:attribute name="blue" type="dc:rgb" use="required"/>
</xsd:complexType>
<xsd:simpleType name="rgb">
<xsd:restriction base="xsd:int">
<xsd:minInclusive value="0"/>
<xsd:maxInclusive value="255"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="Point">
<xsd:annotation>
<xsd:documentation>A Point specifies an location in some x-y coordinate system.</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="x" type="xsd:double" use="required"/>
<xsd:attribute name="y" type="xsd:double" use="required"/>
</xsd:complexType>
<xsd:complexType name="Dimension">
<xsd:annotation>
<xsd:documentation>Dimension specifies two lengths (width and height) along the x and y axes in some x-y coordinate system.</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="width" type="xsd:double" use="required"/>
<xsd:attribute name="height" type="xsd:double" use="required"/>
</xsd:complexType>
<xsd:complexType name="Bounds">
<xsd:annotation>
<xsd:documentation>Bounds specifies a rectangular area in some x-y coordinate system that is defined by a location (x and y) and a size (width and height).</xsd:documentation>
</xsd:annotation>
<xsd:attribute name="x" type="xsd:double" use="required"/>
<xsd:attribute name="y" type="xsd:double" use="required"/>
<xsd:attribute name="width" type="xsd:double" use="required"/>
<xsd:attribute name="height" type="xsd:double" use="required"/>
</xsd:complexType>
<xsd:simpleType name="AlignmentKind">
<xsd:annotation>
<xsd:documentation>AlignmentKind enumerates the possible options for alignment for layout purposes.</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="start"/>
<xsd:enumeration value="end"/>
<xsd:enumeration value="center"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="KnownColor">
<xsd:annotation>
<xsd:documentation>KnownColor is an enumeration of 17 known colors.</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="maroon">
<xsd:annotation>
<xsd:documentation>a color with a value of #800000</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="red">
<xsd:annotation>
<xsd:documentation>a color with a value of #FF0000</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="orange">
<xsd:annotation>
<xsd:documentation>a color with a value of #FFA500</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="yellow">
<xsd:annotation>
<xsd:documentation>a color with a value of #FFFF00</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="olive">
<xsd:annotation>
<xsd:documentation>a color with a value of #808000</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="purple">
<xsd:annotation>
<xsd:documentation>a color with a value of #800080</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="fuchsia">
<xsd:annotation>
<xsd:documentation>a color with a value of #FF00FF</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="white">
<xsd:annotation>
<xsd:documentation>a color with a value of #FFFFFF</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="lime">
<xsd:annotation>
<xsd:documentation>a color with a value of #00FF00</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="green">
<xsd:annotation>
<xsd:documentation>a color with a value of #008000</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="navy">
<xsd:annotation>
<xsd:documentation>a color with a value of #000080</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="blue">
<xsd:annotation>
<xsd:documentation>a color with a value of #0000FF</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="aqua">
<xsd:annotation>
<xsd:documentation>a color with a value of #00FFFF</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="teal">
<xsd:annotation>
<xsd:documentation>a color with a value of #008080</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="black">
<xsd:annotation>
<xsd:documentation>a color with a value of #000000</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="silver">
<xsd:annotation>
<xsd:documentation>a color with a value of #C0C0C0</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
<xsd:enumeration value="gray">
<xsd:annotation>
<xsd:documentation>a color with a value of #808080</xsd:documentation>
</xsd:annotation>
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>

View File

@ -0,0 +1,438 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.omg.org/spec/DMN/20151101/dmn.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.omg.org/spec/DMN/20151101/dmn.xsd" elementFormDefault="qualified">
<xsd:element name="DMNElement" type="tDMNElement" abstract="true"/>
<xsd:complexType name="tDMNElement">
<xsd:sequence>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="extensionElements" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID" use="optional"/>
<xsd:attribute name="label" type="xsd:string" use="optional"/>
<xsd:anyAttribute namespace="##other" processContents="lax"/>
</xsd:complexType>
<xsd:element name="namedElement" type="tNamedElement" abstract="true" substitutionGroup="DMNElement"/>
<xsd:complexType name="tDMNElementReference">
<xsd:attribute name="href" type="xsd:anyURI" use="required"/>
</xsd:complexType>
<xsd:element name="definitions" type="tDefinitions" substitutionGroup="namedElement"/>
<xsd:complexType name="tDefinitions">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:sequence>
<xsd:element name="import" type="tImport" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="itemDefinition" type="tItemDefinition" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="drgElement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="elementCollection" type="tElementCollection" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="businessContextElement" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="expressionLanguage" type="xsd:anyURI" use="optional" default="http://www.omg.org/spec/FEEL/20140401"/>
<xsd:attribute name="typeLanguage" type="xsd:anyURI" use="optional" default="http://www.omg.org/spec/FEEL/20140401"/>
<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"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="import" type="tImport"/>
<xsd:complexType name="tImport">
<xsd:attribute name="namespace" type="xsd:anyURI" use="required"/>
<xsd:attribute name="locationURI" type="xsd:anyURI" use="optional"/>
<xsd:attribute name="importType" type="xsd:anyURI" use="required"/>
</xsd:complexType>
<xsd:element name="elementCollection" type="tElementCollection" substitutionGroup="namedElement"/>
<xsd:complexType name="tElementCollection">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:sequence>
<xsd:element name="drgElement" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="drgElement" type="tDRGElement" abstract="true" substitutionGroup="namedElement"/>
<xsd:complexType name="tDRGElement">
<xsd:complexContent>
<xsd:extension base="tNamedElement"/>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="decision" type="tDecision" substitutionGroup="drgElement"/>
<xsd:complexType name="tDecision">
<xsd:complexContent>
<xsd:extension base="tDRGElement">
<xsd:sequence>
<xsd:element name="question" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="allowedAnswers" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="variable" type="tInformationItem" minOccurs="0"/>
<xsd:element name="informationRequirement" type="tInformationRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="knowledgeRequirement" type="tKnowledgeRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="authorityRequirement" type="tAuthorityRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="supportedObjective" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="impactedPerformanceIndicator" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="decisionMaker" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="decisionOwner" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="usingProcess" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="usingTask" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<!-- decisionLogic -->
<xsd:element ref="expression" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="businessContextElement" type="tBusinessContextElement" abstract="true"/>
<xsd:complexType name="tBusinessContextElement">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="performanceIndicator" type="tPerformanceIndicator" substitutionGroup="businessContextElement"/>
<xsd:complexType name="tPerformanceIndicator">
<xsd:complexContent>
<xsd:extension base="tBusinessContextElement">
<xsd:sequence>
<xsd:element name="impactingDecision" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="organizationUnit" type="tOrganizationUnit" substitutionGroup="businessContextElement"/>
<xsd:complexType name="tOrganizationUnit">
<xsd:complexContent>
<xsd:extension base="tBusinessContextElement">
<xsd:sequence>
<xsd:element name="decisionMade" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="decisionOwned" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="businessKnowledgeModel" type="tBusinessKnowledgeModel" substitutionGroup="drgElement"/>
<xsd:complexType name="tBusinessKnowledgeModel">
<xsd:complexContent>
<xsd:extension base="tDRGElement">
<xsd:sequence>
<xsd:element name="encapsulatedLogic" type="tFunctionDefinition" minOccurs="0" maxOccurs="1"/>
<xsd:element name="variable" type="tInformationItem" minOccurs="0"/>
<xsd:element name="knowledgeRequirement" type="tKnowledgeRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="authorityRequirement" type="tAuthorityRequirement" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="inputData" type="tInputData" substitutionGroup="drgElement"/>
<xsd:complexType name="tInputData">
<xsd:complexContent>
<xsd:extension base="tDRGElement">
<xsd:sequence>
<xsd:element name="variable" type="tInformationItem" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="knowledgeSource" type="tKnowledgeSource" substitutionGroup="drgElement"/>
<xsd:complexType name="tKnowledgeSource">
<xsd:complexContent>
<xsd:extension base="tDRGElement">
<xsd:sequence>
<xsd:element name="authorityRequirement" type="tAuthorityRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="type" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="owner" type="tDMNElementReference" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="locationURI" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tInformationRequirement">
<xsd:sequence>
<xsd:choice minOccurs="1" maxOccurs="1">
<xsd:element name="requiredDecision" type="tDMNElementReference"/>
<xsd:element name="requiredInput" type="tDMNElementReference"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="tKnowledgeRequirement">
<xsd:sequence>
<xsd:element name="requiredKnowledge" type="tDMNElementReference" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="tAuthorityRequirement">
<xsd:choice minOccurs="1" maxOccurs="1">
<xsd:element name="requiredDecision" type="tDMNElementReference"/>
<xsd:element name="requiredInput" type="tDMNElementReference"/>
<xsd:element name="requiredAuthority" type="tDMNElementReference"/>
</xsd:choice>
</xsd:complexType>
<xsd:element name="expression" type="tExpression" abstract="true"/>
<xsd:complexType name="tExpression">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:attribute name="typeRef" type="xsd:QName"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="itemDefinition" type="tItemDefinition" substitutionGroup="namedElement"/>
<xsd:complexType name="tItemDefinition">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:choice>
<xsd:sequence>
<xsd:element name="typeRef" type="xsd:QName"/>
<xsd:element name="allowedValues" type="tUnaryTests" minOccurs="0"/>
</xsd:sequence>
<xsd:element name="itemComponent" type="tItemDefinition" minOccurs="0" maxOccurs="unbounded"/>
</xsd:choice>
<xsd:attribute name="typeLanguage" type="xsd:anyURI" use="optional"/>
<xsd:attribute name="isCollection" type="xsd:boolean" use="optional" default="false"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="literalExpression" type="tLiteralExpression" substitutionGroup="expression"/>
<xsd:complexType name="tLiteralExpression">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:choice minOccurs="0" maxOccurs="1">
<xsd:element name="text" type="xsd:string"/>
<xsd:element name="importedValues" type="tImportedValues"/>
</xsd:choice>
<xsd:attribute name="expressionLanguage" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="invocation" type="tInvocation" substitutionGroup="expression"/>
<xsd:complexType name="tInvocation">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<!-- calledFunction -->
<xsd:element ref="expression" minOccurs="0"/>
<xsd:element name="binding" type="tBinding" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tBinding">
<xsd:sequence>
<xsd:element name="parameter" type="tInformationItem" minOccurs="1" maxOccurs="1"/>
<!-- bindingFormula -->
<xsd:element ref="expression" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="informationItem" type="tInformationItem" substitutionGroup="namedElement"/>
<xsd:complexType name="tInformationItem">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:attribute name="typeRef" type="xsd:QName"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="decisionTable" type="tDecisionTable" substitutionGroup="expression"/>
<xsd:complexType name="tDecisionTable">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element name="input" type="tInputClause" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="output" type="tOutputClause" maxOccurs="unbounded"/>
<!-- NB: when the hit policy is FIRST or RULE ORDER, the ordering of the rules is significant and MUST be preserved -->
<xsd:element name="rule" type="tDecisionRule" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="hitPolicy" type="tHitPolicy" use="optional" default="UNIQUE"/>
<xsd:attribute name="aggregation" type="tBuiltinAggregator" use="optional"/>
<xsd:attribute name="preferredOrientation" type="tDecisionTableOrientation" use="optional" default="Rule-as-Row"/>
<xsd:attribute name="outputLabel" type="xsd:string" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tDecisionRule">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="inputEntry" type="tUnaryTests" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="outputEntry" type="tLiteralExpression" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tImportedValues">
<xsd:complexContent>
<xsd:extension base="tImport">
<xsd:sequence>
<xsd:element name="importedElement" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="expressionLanguage" type="xsd:anyURI"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="artifact" type="tArtifact" abstract="true" substitutionGroup="DMNElement"/>
<xsd:complexType name="tArtifact">
<xsd:complexContent>
<xsd:extension base="tDMNElement"/>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="textAnnotation" type="tTextAnnotation" substitutionGroup="artifact"/>
<xsd:complexType name="tTextAnnotation">
<xsd:complexContent>
<xsd:extension base="tArtifact">
<xsd:sequence>
<xsd:element name="text" type="xsd:string" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="textFormat" type="xsd:string" default="text/plain"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="association" type="tAssociation" substitutionGroup="artifact"/>
<xsd:complexType name="tAssociation">
<xsd:complexContent>
<xsd:extension base="tArtifact">
<xsd:sequence>
<xsd:element name="sourceRef" type="tDMNElementReference"/>
<xsd:element name="targetRef" type="tDMNElementReference"/>
</xsd:sequence>
<xsd:attribute name="associationDirection" type="tAssociationDirection" default="None"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:simpleType name="tAssociationDirection">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="None"/>
<xsd:enumeration value="One"/>
<xsd:enumeration value="Both"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="tDecisionTableOrientation">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Rule-as-Row"/>
<xsd:enumeration value="Rule-as-Column"/>
<xsd:enumeration value="CrossTable"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="tHitPolicy">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="UNIQUE"/>
<xsd:enumeration value="FIRST"/>
<xsd:enumeration value="PRIORITY"/>
<xsd:enumeration value="ANY"/>
<xsd:enumeration value="COLLECT"/>
<xsd:enumeration value="RULE ORDER"/>
<xsd:enumeration value="OUTPUT ORDER"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="tBuiltinAggregator">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="SUM"/>
<xsd:enumeration value="COUNT"/>
<xsd:enumeration value="MIN"/>
<xsd:enumeration value="MAX"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="tOutputClause">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="outputValues" type="tUnaryTests" minOccurs="0"/>
<xsd:element name="defaultOutputEntry" type="tLiteralExpression" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="optional"/>
<xsd:attribute name="typeRef" type="xsd:QName"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tInputClause">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="inputExpression" type="tLiteralExpression"/>
<xsd:element name="inputValues" type="tUnaryTests" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="context" type="tContext" substitutionGroup="expression"/>
<xsd:complexType name="tContext">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element name="contextEntry" type="tContextEntry" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tContextEntry">
<xsd:sequence>
<xsd:element name="variable" type="tInformationItem" minOccurs="0" maxOccurs="1"/>
<!-- value -->
<xsd:element ref="expression" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="functionDefinition" type="tFunctionDefinition" substitutionGroup="expression"/>
<xsd:complexType name="tFunctionDefinition">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element name="formalParameter" type="tInformationItem" minOccurs="0" maxOccurs="unbounded"/>
<!-- body -->
<xsd:element ref="expression" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="relation" type="tRelation" substitutionGroup="expression"/>
<xsd:complexType name="tRelation">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element name="column" type="tInformationItem" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="row" type="tList" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="list" type="tList" substitutionGroup="expression"/>
<xsd:complexType name="tList">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<!-- element -->
<xsd:element ref="expression" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tUnaryTests">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="text" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="expressionLanguage" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tNamedElement">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="decisionService" type="tDecisionService" substitutionGroup="namedElement"/>
<xsd:complexType name="tDecisionService">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:sequence>
<xsd:element name="outputDecision" type="tDMNElementReference" maxOccurs="unbounded"/>
<xsd:element name="encapsulatedDecision" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="inputDecision" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="inputData" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,504 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema elementFormDefault="qualified"
xmlns="http://www.omg.org/spec/DMN/20180521/MODEL/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:dmndi="http://www.omg.org/spec/DMN/20180521/DMNDI/"
targetNamespace="http://www.omg.org/spec/DMN/20180521/MODEL/">
<xsd:import namespace="http://www.omg.org/spec/DMN/20180521/DMNDI/"
schemaLocation="DMNDI12.xsd">
<xsd:annotation>
<xsd:documentation>
Include the DMN Diagram Interchange (DI) schema
</xsd:documentation>
</xsd:annotation>
</xsd:import>
<xsd:element name="DMNElement" type="tDMNElement" abstract="true"/>
<xsd:complexType name="tDMNElement">
<xsd:sequence>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="extensionElements" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID" use="optional"/>
<xsd:attribute name="label" type="xsd:string" use="optional"/>
<xsd:anyAttribute namespace="##other" processContents="lax"/>
</xsd:complexType>
<xsd:element name="namedElement" type="tNamedElement" abstract="true" substitutionGroup="DMNElement"/>
<xsd:complexType name="tNamedElement">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tDMNElementReference">
<xsd:attribute name="href" type="xsd:anyURI" use="required"/>
</xsd:complexType>
<xsd:element name="definitions" type="tDefinitions" substitutionGroup="namedElement"/>
<xsd:complexType name="tDefinitions">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:sequence>
<xsd:element ref="import" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="itemDefinition" type="tItemDefinition" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="drgElement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="elementCollection" type="tElementCollection" minOccurs="0" maxOccurs="unbounded"/>
<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="http://www.omg.org/spec/DMN/20180521/FEEL/"/>
<xsd:attribute name="typeLanguage" type="xsd:anyURI" use="optional" default="http://www.omg.org/spec/DMN/20180521/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"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="import" type="tImport" substitutionGroup="namedElement"/>
<xsd:complexType name="tImport">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:attribute name="namespace" type="xsd:anyURI" use="required"/>
<xsd:attribute name="locationURI" type="xsd:anyURI" use="optional"/>
<xsd:attribute name="importType" type="xsd:anyURI" use="required"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="elementCollection" type="tElementCollection" substitutionGroup="namedElement"/>
<xsd:complexType name="tElementCollection">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:sequence>
<xsd:element name="drgElement" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="drgElement" type="tDRGElement" abstract="true" substitutionGroup="namedElement"/>
<xsd:complexType name="tDRGElement">
<xsd:complexContent>
<xsd:extension base="tNamedElement"/>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="decision" type="tDecision" substitutionGroup="drgElement"/>
<xsd:complexType name="tDecision">
<xsd:complexContent>
<xsd:extension base="tDRGElement">
<xsd:sequence>
<xsd:element name="question" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="allowedAnswers" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="variable" type="tInformationItem" minOccurs="0"/>
<xsd:element name="informationRequirement" type="tInformationRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="knowledgeRequirement" type="tKnowledgeRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="authorityRequirement" type="tAuthorityRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="supportedObjective" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="impactedPerformanceIndicator" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="decisionMaker" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="decisionOwner" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="usingProcess" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="usingTask" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<!-- decisionLogic -->
<xsd:element ref="expression" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="businessContextElement" type="tBusinessContextElement" abstract="true"/>
<xsd:complexType name="tBusinessContextElement">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="performanceIndicator" type="tPerformanceIndicator" substitutionGroup="businessContextElement"/>
<xsd:complexType name="tPerformanceIndicator">
<xsd:complexContent>
<xsd:extension base="tBusinessContextElement">
<xsd:sequence>
<xsd:element name="impactingDecision" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="organizationUnit" type="tOrganizationUnit" substitutionGroup="businessContextElement"/>
<xsd:complexType name="tOrganizationUnit">
<xsd:complexContent>
<xsd:extension base="tBusinessContextElement">
<xsd:sequence>
<xsd:element name="decisionMade" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="decisionOwned" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="invocable" type="tInvocable" abstract="true" substitutionGroup="drgElement"/>
<xsd:complexType name="tInvocable">
<xsd:complexContent>
<xsd:extension base="tDRGElement">
<xsd:sequence>
<xsd:element name="variable" type="tInformationItem" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="businessKnowledgeModel" type="tBusinessKnowledgeModel" substitutionGroup="invocable"/>
<xsd:complexType name="tBusinessKnowledgeModel">
<xsd:complexContent>
<xsd:extension base="tInvocable">
<xsd:sequence>
<xsd:element name="encapsulatedLogic" type="tFunctionDefinition" minOccurs="0" maxOccurs="1"/>
<xsd:element name="knowledgeRequirement" type="tKnowledgeRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="authorityRequirement" type="tAuthorityRequirement" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="inputData" type="tInputData" substitutionGroup="drgElement"/>
<xsd:complexType name="tInputData">
<xsd:complexContent>
<xsd:extension base="tDRGElement">
<xsd:sequence>
<xsd:element name="variable" type="tInformationItem" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="knowledgeSource" type="tKnowledgeSource" substitutionGroup="drgElement"/>
<xsd:complexType name="tKnowledgeSource">
<xsd:complexContent>
<xsd:extension base="tDRGElement">
<xsd:sequence>
<xsd:element name="authorityRequirement" type="tAuthorityRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="type" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="owner" type="tDMNElementReference" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="locationURI" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="informationRequirement" type="tInformationRequirement" substitutionGroup="DMNElement"/>
<xsd:complexType name="tInformationRequirement">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:choice minOccurs="1" maxOccurs="1">
<xsd:element name="requiredDecision" type="tDMNElementReference"/>
<xsd:element name="requiredInput" type="tDMNElementReference"/>
</xsd:choice>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="knowledgeRequirement" type="tKnowledgeRequirement" substitutionGroup="DMNElement"/>
<xsd:complexType name="tKnowledgeRequirement">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="requiredKnowledge" type="tDMNElementReference" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="authorityRequirement" type="tAuthorityRequirement" substitutionGroup="DMNElement"/>
<xsd:complexType name="tAuthorityRequirement">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:choice minOccurs="1" maxOccurs="1">
<xsd:element name="requiredDecision" type="tDMNElementReference"/>
<xsd:element name="requiredInput" type="tDMNElementReference"/>
<xsd:element name="requiredAuthority" type="tDMNElementReference"/>
</xsd:choice>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="expression" type="tExpression" abstract="true"/>
<xsd:complexType name="tExpression">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:attribute name="typeRef" type="xsd:string"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="itemDefinition" type="tItemDefinition" substitutionGroup="namedElement"/>
<xsd:complexType name="tItemDefinition">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:choice>
<xsd:sequence>
<xsd:element name="typeRef" type="xsd:string"/>
<xsd:element name="allowedValues" type="tUnaryTests" minOccurs="0"/>
</xsd:sequence>
<xsd:element name="itemComponent" type="tItemDefinition" minOccurs="0" maxOccurs="unbounded"/>
</xsd:choice>
<xsd:attribute name="typeLanguage" type="xsd:anyURI" use="optional"/>
<xsd:attribute name="isCollection" type="xsd:boolean" use="optional" default="false"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="literalExpression" type="tLiteralExpression" substitutionGroup="expression"/>
<xsd:complexType name="tLiteralExpression">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:choice minOccurs="0" maxOccurs="1">
<xsd:element name="text" type="xsd:string"/>
<xsd:element name="importedValues" type="tImportedValues"/>
</xsd:choice>
<xsd:attribute name="expressionLanguage" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="invocation" type="tInvocation" substitutionGroup="expression"/>
<xsd:complexType name="tInvocation">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<!-- calledFunction -->
<xsd:element ref="expression" minOccurs="0"/>
<xsd:element name="binding" type="tBinding" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tBinding">
<xsd:sequence>
<xsd:element name="parameter" type="tInformationItem" minOccurs="1" maxOccurs="1"/>
<!-- bindingFormula -->
<xsd:element ref="expression" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="informationItem" type="tInformationItem" substitutionGroup="namedElement"/>
<xsd:complexType name="tInformationItem">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:attribute name="typeRef" type="xsd:string"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="decisionTable" type="tDecisionTable" substitutionGroup="expression"/>
<xsd:complexType name="tDecisionTable">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element name="input" type="tInputClause" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="output" type="tOutputClause" maxOccurs="unbounded"/>
<xsd:element name="annotation" type="tRuleAnnotationClause" minOccurs="0" maxOccurs="unbounded"/>
<!-- NB: when the hit policy is FIRST or RULE ORDER, the ordering of the rules is significant and MUST be preserved -->
<xsd:element name="rule" type="tDecisionRule" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="hitPolicy" type="tHitPolicy" use="optional" default="UNIQUE"/>
<xsd:attribute name="aggregation" type="tBuiltinAggregator" use="optional"/>
<xsd:attribute name="preferredOrientation" type="tDecisionTableOrientation" use="optional" default="Rule-as-Row"/>
<xsd:attribute name="outputLabel" type="xsd:string" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tInputClause">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="inputExpression" type="tLiteralExpression"/>
<xsd:element name="inputValues" type="tUnaryTests" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tOutputClause">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="outputValues" type="tUnaryTests" minOccurs="0"/>
<xsd:element name="defaultOutputEntry" type="tLiteralExpression" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="optional"/>
<xsd:attribute name="typeRef" type="xsd:string"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tRuleAnnotationClause">
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
<xsd:complexType name="tDecisionRule">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="inputEntry" type="tUnaryTests" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="outputEntry" type="tLiteralExpression" maxOccurs="unbounded"/>
<xsd:element name="annotationEntry" type="tRuleAnnotation" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tRuleAnnotation">
<xsd:sequence>
<xsd:element name="text" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="tHitPolicy">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="UNIQUE"/>
<xsd:enumeration value="FIRST"/>
<xsd:enumeration value="PRIORITY"/>
<xsd:enumeration value="ANY"/>
<xsd:enumeration value="COLLECT"/>
<xsd:enumeration value="RULE ORDER"/>
<xsd:enumeration value="OUTPUT ORDER"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="tBuiltinAggregator">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="SUM"/>
<xsd:enumeration value="COUNT"/>
<xsd:enumeration value="MIN"/>
<xsd:enumeration value="MAX"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="tDecisionTableOrientation">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Rule-as-Row"/>
<xsd:enumeration value="Rule-as-Column"/>
<xsd:enumeration value="CrossTable"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="tImportedValues">
<xsd:complexContent>
<xsd:extension base="tImport">
<xsd:sequence>
<xsd:element name="importedElement" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="expressionLanguage" type="xsd:anyURI"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="artifact" type="tArtifact" abstract="true" substitutionGroup="DMNElement"/>
<xsd:complexType name="tArtifact">
<xsd:complexContent>
<xsd:extension base="tDMNElement"/>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="textAnnotation" type="tTextAnnotation" substitutionGroup="artifact"/>
<xsd:complexType name="tTextAnnotation">
<xsd:complexContent>
<xsd:extension base="tArtifact">
<xsd:sequence>
<xsd:element name="text" type="xsd:string" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="textFormat" type="xsd:string" default="text/plain"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="association" type="tAssociation" substitutionGroup="artifact"/>
<xsd:complexType name="tAssociation">
<xsd:complexContent>
<xsd:extension base="tArtifact">
<xsd:sequence>
<xsd:element name="sourceRef" type="tDMNElementReference"/>
<xsd:element name="targetRef" type="tDMNElementReference"/>
</xsd:sequence>
<xsd:attribute name="associationDirection" type="tAssociationDirection" default="None"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:simpleType name="tAssociationDirection">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="None"/>
<xsd:enumeration value="One"/>
<xsd:enumeration value="Both"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="context" type="tContext" substitutionGroup="expression"/>
<xsd:complexType name="tContext">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element ref="contextEntry" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="contextEntry" type="tContextEntry" substitutionGroup="DMNElement"/>
<xsd:complexType name="tContextEntry">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="variable" type="tInformationItem" minOccurs="0" maxOccurs="1"/>
<!-- value -->
<xsd:element ref="expression" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="functionDefinition" type="tFunctionDefinition" substitutionGroup="expression"/>
<xsd:complexType name="tFunctionDefinition">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element name="formalParameter" type="tInformationItem" minOccurs="0" maxOccurs="unbounded"/>
<!-- body -->
<xsd:element ref="expression" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="kind" type="tFunctionKind" default="FEEL"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:simpleType name="tFunctionKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="FEEL"/>
<xsd:enumeration value="Java"/>
<xsd:enumeration value="PMML"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="relation" type="tRelation" substitutionGroup="expression"/>
<xsd:complexType name="tRelation">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element name="column" type="tInformationItem" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="row" type="tList" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="list" type="tList" substitutionGroup="expression"/>
<xsd:complexType name="tList">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<!-- element -->
<xsd:element ref="expression" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tUnaryTests">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="text" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="expressionLanguage" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="decisionService" type="tDecisionService" substitutionGroup="invocable"/>
<xsd:complexType name="tDecisionService">
<xsd:complexContent>
<xsd:extension base="tInvocable">
<xsd:sequence>
<xsd:element name="outputDecision" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="encapsulatedDecision" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="inputDecision" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="inputData" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,524 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema elementFormDefault="qualified"
xmlns="https://www.omg.org/spec/DMN/20191111/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/20191111/MODEL/">
<xsd:import namespace="https://www.omg.org/spec/DMN/20191111/DMNDI/"
schemaLocation="DMNDI13.xsd">
<xsd:annotation>
<xsd:documentation>
Include the DMN Diagram Interchange (DI) schema
</xsd:documentation>
</xsd:annotation>
</xsd:import>
<xsd:element name="DMNElement" type="tDMNElement" abstract="true"/>
<xsd:complexType name="tDMNElement">
<xsd:sequence>
<xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="extensionElements" minOccurs="0" maxOccurs="1">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID" use="optional"/>
<xsd:attribute name="label" type="xsd:string" use="optional"/>
<xsd:anyAttribute namespace="##other" processContents="lax"/>
</xsd:complexType>
<xsd:element name="namedElement" type="tNamedElement" abstract="true" substitutionGroup="DMNElement"/>
<xsd:complexType name="tNamedElement">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:attribute name="name" type="xsd:string" use="required"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tDMNElementReference">
<xsd:attribute name="href" type="xsd:anyURI" use="required"/>
</xsd:complexType>
<xsd:element name="definitions" type="tDefinitions" substitutionGroup="namedElement"/>
<xsd:complexType name="tDefinitions">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:sequence>
<xsd:element ref="import" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="itemDefinition" type="tItemDefinition" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="drgElement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="artifact" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="elementCollection" type="tElementCollection" minOccurs="0" maxOccurs="unbounded"/>
<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/20191111/FEEL/"/>
<xsd:attribute name="typeLanguage" type="xsd:anyURI" use="optional" default="https://www.omg.org/spec/DMN/20191111/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"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="import" type="tImport" substitutionGroup="namedElement"/>
<xsd:complexType name="tImport">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:attribute name="namespace" type="xsd:anyURI" use="required"/>
<xsd:attribute name="locationURI" type="xsd:anyURI" use="optional"/>
<xsd:attribute name="importType" type="xsd:anyURI" use="required"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="elementCollection" type="tElementCollection" substitutionGroup="namedElement"/>
<xsd:complexType name="tElementCollection">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:sequence>
<xsd:element name="drgElement" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="drgElement" type="tDRGElement" abstract="true" substitutionGroup="namedElement"/>
<xsd:complexType name="tDRGElement">
<xsd:complexContent>
<xsd:extension base="tNamedElement"/>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="decision" type="tDecision" substitutionGroup="drgElement"/>
<xsd:complexType name="tDecision">
<xsd:complexContent>
<xsd:extension base="tDRGElement">
<xsd:sequence>
<xsd:element name="question" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="allowedAnswers" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="variable" type="tInformationItem" minOccurs="0"/>
<xsd:element name="informationRequirement" type="tInformationRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="knowledgeRequirement" type="tKnowledgeRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="authorityRequirement" type="tAuthorityRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="supportedObjective" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="impactedPerformanceIndicator" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="decisionMaker" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="decisionOwner" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="usingProcess" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="usingTask" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<!-- decisionLogic -->
<xsd:element ref="expression" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="businessContextElement" type="tBusinessContextElement" abstract="true"/>
<xsd:complexType name="tBusinessContextElement">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="performanceIndicator" type="tPerformanceIndicator" substitutionGroup="businessContextElement"/>
<xsd:complexType name="tPerformanceIndicator">
<xsd:complexContent>
<xsd:extension base="tBusinessContextElement">
<xsd:sequence>
<xsd:element name="impactingDecision" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="organizationUnit" type="tOrganizationUnit" substitutionGroup="businessContextElement"/>
<xsd:complexType name="tOrganizationUnit">
<xsd:complexContent>
<xsd:extension base="tBusinessContextElement">
<xsd:sequence>
<xsd:element name="decisionMade" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="decisionOwned" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="invocable" type="tInvocable" abstract="true" substitutionGroup="drgElement"/>
<xsd:complexType name="tInvocable">
<xsd:complexContent>
<xsd:extension base="tDRGElement">
<xsd:sequence>
<xsd:element name="variable" type="tInformationItem" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="businessKnowledgeModel" type="tBusinessKnowledgeModel" substitutionGroup="invocable"/>
<xsd:complexType name="tBusinessKnowledgeModel">
<xsd:complexContent>
<xsd:extension base="tInvocable">
<xsd:sequence>
<xsd:element name="encapsulatedLogic" type="tFunctionDefinition" minOccurs="0" maxOccurs="1"/>
<xsd:element name="knowledgeRequirement" type="tKnowledgeRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="authorityRequirement" type="tAuthorityRequirement" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="inputData" type="tInputData" substitutionGroup="drgElement"/>
<xsd:complexType name="tInputData">
<xsd:complexContent>
<xsd:extension base="tDRGElement">
<xsd:sequence>
<xsd:element name="variable" type="tInformationItem" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="knowledgeSource" type="tKnowledgeSource" substitutionGroup="drgElement"/>
<xsd:complexType name="tKnowledgeSource">
<xsd:complexContent>
<xsd:extension base="tDRGElement">
<xsd:sequence>
<xsd:element name="authorityRequirement" type="tAuthorityRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="type" type="xsd:string" minOccurs="0" maxOccurs="1"/>
<xsd:element name="owner" type="tDMNElementReference" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="locationURI" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="informationRequirement" type="tInformationRequirement" substitutionGroup="DMNElement"/>
<xsd:complexType name="tInformationRequirement">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:choice minOccurs="1" maxOccurs="1">
<xsd:element name="requiredDecision" type="tDMNElementReference"/>
<xsd:element name="requiredInput" type="tDMNElementReference"/>
</xsd:choice>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="knowledgeRequirement" type="tKnowledgeRequirement" substitutionGroup="DMNElement"/>
<xsd:complexType name="tKnowledgeRequirement">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="requiredKnowledge" type="tDMNElementReference" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="authorityRequirement" type="tAuthorityRequirement" substitutionGroup="DMNElement"/>
<xsd:complexType name="tAuthorityRequirement">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:choice minOccurs="1" maxOccurs="1">
<xsd:element name="requiredDecision" type="tDMNElementReference"/>
<xsd:element name="requiredInput" type="tDMNElementReference"/>
<xsd:element name="requiredAuthority" type="tDMNElementReference"/>
</xsd:choice>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="expression" type="tExpression" abstract="true"/>
<xsd:complexType name="tExpression">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:attribute name="typeRef" type="xsd:string" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="itemDefinition" type="tItemDefinition" substitutionGroup="namedElement"/>
<xsd:complexType name="tItemDefinition">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:choice>
<xsd:sequence>
<xsd:element name="typeRef" type="xsd:string"/>
<xsd:element name="allowedValues" type="tUnaryTests" minOccurs="0"/>
</xsd:sequence>
<xsd:element name="itemComponent" type="tItemDefinition" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="functionItem" type="tFunctionItem" minOccurs="0" maxOccurs="1"/>
</xsd:choice>
<xsd:attribute name="typeLanguage" type="xsd:anyURI" use="optional"/>
<xsd:attribute name="isCollection" type="xsd:boolean" use="optional" default="false"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="functionItem" type="tFunctionItem" substitutionGroup="DMNElement"/>
<xsd:complexType name="tFunctionItem">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="parameters" type="tInformationItem" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="outputTypeRef" type="xsd:string"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="literalExpression" type="tLiteralExpression" substitutionGroup="expression"/>
<xsd:complexType name="tLiteralExpression">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:choice minOccurs="0" maxOccurs="1">
<xsd:element name="text" type="xsd:string"/>
<xsd:element name="importedValues" type="tImportedValues"/>
</xsd:choice>
<xsd:attribute name="expressionLanguage" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="invocation" type="tInvocation" substitutionGroup="expression"/>
<xsd:complexType name="tInvocation">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<!-- calledFunction -->
<xsd:element ref="expression" minOccurs="0"/>
<xsd:element name="binding" type="tBinding" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tBinding">
<xsd:sequence>
<xsd:element name="parameter" type="tInformationItem" minOccurs="1" maxOccurs="1"/>
<!-- bindingFormula -->
<xsd:element ref="expression" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="informationItem" type="tInformationItem" substitutionGroup="namedElement"/>
<xsd:complexType name="tInformationItem">
<xsd:complexContent>
<xsd:extension base="tNamedElement">
<xsd:attribute name="typeRef" type="xsd:string"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="decisionTable" type="tDecisionTable" substitutionGroup="expression"/>
<xsd:complexType name="tDecisionTable">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element name="input" type="tInputClause" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="output" type="tOutputClause" maxOccurs="unbounded"/>
<xsd:element name="annotation" type="tRuleAnnotationClause" minOccurs="0" maxOccurs="unbounded"/>
<!-- NB: when the hit policy is FIRST or RULE ORDER, the ordering of the rules is significant and MUST be preserved -->
<xsd:element name="rule" type="tDecisionRule" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="hitPolicy" type="tHitPolicy" use="optional" default="UNIQUE"/>
<xsd:attribute name="aggregation" type="tBuiltinAggregator" use="optional"/>
<xsd:attribute name="preferredOrientation" type="tDecisionTableOrientation" use="optional" default="Rule-as-Row"/>
<xsd:attribute name="outputLabel" type="xsd:string" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tInputClause">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="inputExpression" type="tLiteralExpression"/>
<xsd:element name="inputValues" type="tUnaryTests" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tOutputClause">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="outputValues" type="tUnaryTests" minOccurs="0"/>
<xsd:element name="defaultOutputEntry" type="tLiteralExpression" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="optional"/>
<xsd:attribute name="typeRef" type="xsd:string"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tRuleAnnotationClause">
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
<xsd:complexType name="tDecisionRule">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="inputEntry" type="tUnaryTests" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="outputEntry" type="tLiteralExpression" maxOccurs="unbounded"/>
<xsd:element name="annotationEntry" type="tRuleAnnotation" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tRuleAnnotation">
<xsd:sequence>
<xsd:element name="text" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="tHitPolicy">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="UNIQUE"/>
<xsd:enumeration value="FIRST"/>
<xsd:enumeration value="PRIORITY"/>
<xsd:enumeration value="ANY"/>
<xsd:enumeration value="COLLECT"/>
<xsd:enumeration value="RULE ORDER"/>
<xsd:enumeration value="OUTPUT ORDER"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="tBuiltinAggregator">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="SUM"/>
<xsd:enumeration value="COUNT"/>
<xsd:enumeration value="MIN"/>
<xsd:enumeration value="MAX"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="tDecisionTableOrientation">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Rule-as-Row"/>
<xsd:enumeration value="Rule-as-Column"/>
<xsd:enumeration value="CrossTable"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="tImportedValues">
<xsd:complexContent>
<xsd:extension base="tImport">
<xsd:sequence>
<xsd:element name="importedElement" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="expressionLanguage" type="xsd:anyURI"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="artifact" type="tArtifact" abstract="true" substitutionGroup="DMNElement"/>
<xsd:complexType name="tArtifact">
<xsd:complexContent>
<xsd:extension base="tDMNElement"/>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="group" type="tGroup" substitutionGroup="artifact"/>
<xsd:complexType name="tGroup">
<xsd:complexContent>
<xsd:extension base="tArtifact">
<xsd:attribute name="name" type="xsd:string" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="textAnnotation" type="tTextAnnotation" substitutionGroup="artifact"/>
<xsd:complexType name="tTextAnnotation">
<xsd:complexContent>
<xsd:extension base="tArtifact">
<xsd:sequence>
<xsd:element name="text" type="xsd:string" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="textFormat" type="xsd:string" default="text/plain"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="association" type="tAssociation" substitutionGroup="artifact"/>
<xsd:complexType name="tAssociation">
<xsd:complexContent>
<xsd:extension base="tArtifact">
<xsd:sequence>
<xsd:element name="sourceRef" type="tDMNElementReference"/>
<xsd:element name="targetRef" type="tDMNElementReference"/>
</xsd:sequence>
<xsd:attribute name="associationDirection" type="tAssociationDirection" default="None"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:simpleType name="tAssociationDirection">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="None"/>
<xsd:enumeration value="One"/>
<xsd:enumeration value="Both"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="context" type="tContext" substitutionGroup="expression"/>
<xsd:complexType name="tContext">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element ref="contextEntry" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="contextEntry" type="tContextEntry" substitutionGroup="DMNElement"/>
<xsd:complexType name="tContextEntry">
<xsd:complexContent>
<xsd:extension base="tDMNElement">
<xsd:sequence>
<xsd:element name="variable" type="tInformationItem" minOccurs="0" maxOccurs="1"/>
<!-- value -->
<xsd:element ref="expression" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="functionDefinition" type="tFunctionDefinition" substitutionGroup="expression"/>
<xsd:complexType name="tFunctionDefinition">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element name="formalParameter" type="tInformationItem" minOccurs="0" maxOccurs="unbounded"/>
<!-- body -->
<xsd:element ref="expression" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="kind" type="tFunctionKind" default="FEEL"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:simpleType name="tFunctionKind">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="FEEL"/>
<xsd:enumeration value="Java"/>
<xsd:enumeration value="PMML"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="relation" type="tRelation" substitutionGroup="expression"/>
<xsd:complexType name="tRelation">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element name="column" type="tInformationItem" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="row" type="tList" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="list" type="tList" substitutionGroup="expression"/>
<xsd:complexType name="tList">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<!-- element -->
<xsd:element ref="expression" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="tUnaryTests">
<xsd:complexContent>
<xsd:extension base="tExpression">
<xsd:sequence>
<xsd:element name="text" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="expressionLanguage" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="decisionService" type="tDecisionService" substitutionGroup="invocable"/>
<xsd:complexType name="tDecisionService">
<xsd:complexContent>
<xsd:extension base="tInvocable">
<xsd:sequence>
<xsd:element name="outputDecision" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="encapsulatedDecision" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="inputDecision" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="inputData" type="tDMNElementReference" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/"
xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/"
targetNamespace="http://www.omg.org/spec/DMN/20180521/DI/"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xsd:import namespace="http://www.omg.org/spec/DMN/20180521/DC/"
schemaLocation="DC.xsd"/>
<xsd:annotation>
<xsd:documentation>The Diagram Interchange (DI) package enables interchange of graphical information that language users have control over, such as position of nodes and line routing points. Language specifications specialize elements of DI to define diagram interchange elements for a language.</xsd:documentation>
</xsd:annotation>
<xsd:element name="Style" type="di:Style">
<xsd:annotation>
<xsd:documentation>This element should never be instantiated directly, but rather concrete implementation should. It is placed there only to be referred in the sequence</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:complexType name="DiagramElement" abstract="true">
<xsd:annotation>
<xsd:documentation>DiagramElement is the abstract super type of all elements in diagrams, including diagrams themselves. When contained in a diagram, diagram elements are laid out relative to the diagram's origin.</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="extension" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element ref="di:Style" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>an optional locally-owned style for this diagram element.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="sharedStyle" type="xsd:IDREF">
<xsd:annotation>
<xsd:documentation>a reference to an optional shared style element for this diagram element.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="id" type="xsd:ID"/>
<xsd:anyAttribute namespace="##other" processContents="lax"/>
</xsd:complexType>
<xsd:complexType name="Diagram" abstract="true">
<xsd:complexContent>
<xsd:extension base="di:DiagramElement">
<xsd:attribute name="name" type="xsd:string">
<xsd:annotation>
<xsd:documentation>the name of the diagram.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="documentation" type="xsd:string">
<xsd:annotation>
<xsd:documentation>the documentation of the diagram.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="resolution" type="xsd:double">
<xsd:annotation>
<xsd:documentation>the resolution of the diagram expressed in user units per inch.</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Shape" abstract="true">
<xsd:complexContent>
<xsd:extension base="di:DiagramElement">
<xsd:sequence>
<xsd:element ref="dc:Bounds" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>the optional bounds of the shape relative to the origin of its nesting plane.</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Edge" abstract="true">
<xsd:complexContent>
<xsd:extension base="di:DiagramElement">
<xsd:sequence>
<xsd:element name="waypoint" type="dc:Point" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>an optional list of points relative to the origin of the nesting diagram that specifies the connected line segments of the edge</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="Style" abstract="true">
<xsd:annotation>
<xsd:documentation>Style contains formatting properties that affect the appearance or style of diagram elements, including diagram themselves.</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="extension" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID"/>
<xsd:anyAttribute namespace="##other" processContents="lax"/>
</xsd:complexType>
</xsd:schema>

View File

@ -0,0 +1,108 @@
<?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: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/"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:import namespace="http://www.omg.org/spec/DMN/20180521/DC/"
schemaLocation="DC.xsd"/>
<xsd:import namespace="http://www.omg.org/spec/DMN/20180521/DI/"
schemaLocation="DMNDI12.xsd"/>
<xsd:element name="DMNDI" type="dmndi:DMNDI"/>
<xsd:element name="DMNDiagram" type="dmndi:DMNDiagram"/>
<xsd:element name="DMNDiagramElement" type="di:DiagramElement">
<xsd:annotation>
<xsd:documentation>This element should never be instantiated directly, but rather concrete implementation should. It is placed there only to be referred in the sequence</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="DMNShape" type="dmndi:DMNShape" substitutionGroup="dmndi:DMNDiagramElement"/>
<xsd:element name="DMNEdge" type="dmndi:DMNEdge" substitutionGroup="dmndi:DMNDiagramElement"/>
<xsd:element name="DMNStyle" type="dmndi:DMNStyle" substitutionGroup="di:Style"/>
<xsd:element name="DMNLabel" type="dmndi:DMNLabel"/>
<xsd:element name="DMNDecisionServiceDividerLine" type="dmndi:DMNDecisionServiceDividerLine"/>
<xsd:complexType name="DMNDI">
<xsd:sequence>
<xsd:element ref="dmndi:DMNDiagram" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="dmndi:DMNStyle" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="DMNDiagram">
<xsd:complexContent>
<xsd:extension base="di:Diagram">
<xsd:sequence>
<xsd:element name="Size" type="dc:Dimension" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="dmndi:DMNDiagramElement" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="DMNShape">
<xsd:complexContent>
<xsd:extension base="di:Shape">
<xsd:sequence>
<xsd:element ref="dmndi:DMNLabel" minOccurs="0" maxOccurs="1"/>
<xsd:element ref="dmndi:DMNDecisionServiceDividerLine" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="dmnElementRef" type="xsd:QName" use="required"/>
<xsd:attribute name="isListedInputData" type="xsd:boolean" use="optional"/>
<xsd:attribute name="isCollapsed" type="xsd:boolean" use="optional" default="false"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="DMNDecisionServiceDividerLine">
<xsd:complexContent>
<xsd:extension base="di:Edge"/>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="DMNEdge">
<xsd:complexContent>
<xsd:extension base="di:Edge">
<xsd:sequence>
<xsd:element ref="dmndi:DMNLabel" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="dmnElementRef" type="xsd:QName" use="required"/>
<xsd:attribute name="sourceElement" type="xsd:QName" use="optional"/>
<xsd:attribute name="targetElement" type="xsd:QName" use="optional"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="DMNLabel">
<xsd:complexContent>
<xsd:extension base="di:Shape">
<xsd:sequence>
<xsd:element name="Text" type="xsd:string" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="DMNStyle">
<xsd:complexContent>
<xsd:extension base="di:Style">
<xsd:sequence>
<xsd:element name="FillColor" type="dc:Color" minOccurs="0" maxOccurs="1"/>
<xsd:element name="StrokeColor" type="dc:Color" minOccurs="0" maxOccurs="1"/>
<xsd:element name="FontColor" type="dc:Color" minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="fontFamily" type="xsd:string"/>
<xsd:attribute name="fontSize" type="xsd:double"/>
<xsd:attribute name="fontItalic" type="xsd:boolean"/>
<xsd:attribute name="fontBold" type="xsd:boolean"/>
<xsd:attribute name="fontUnderline" type="xsd:boolean"/>
<xsd:attribute name="fontStrikeThrough" type="xsd:boolean"/>
<xsd:attribute name="labelHorizontalAlignement" type="dc:AlignmentKind"/>
<xsd:attribute name="labelVerticalAlignment" type="dc:AlignmentKind"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>

View File

@ -1 +1 @@
from .process import SpiffBpmnParser
from .process import SpiffBpmnParser, VALIDATOR

View File

@ -1,5 +1,7 @@
import os
from SpiffWorkflow.dmn.parser.BpmnDmnParser import BpmnDmnParser
from SpiffWorkflow.bpmn.parser.BpmnParser import full_tag
from SpiffWorkflow.bpmn.parser.BpmnParser import BpmnValidator, full_tag
from SpiffWorkflow.bpmn.specs.events import StartEvent, EndEvent, IntermediateThrowEvent, BoundaryEvent, IntermediateCatchEvent
from SpiffWorkflow.spiff.specs import NoneTask, ManualTask, UserTask, ScriptTask, SubWorkflowTask, TransactionSubprocess, CallActivity, ServiceTask
@ -11,6 +13,10 @@ from SpiffWorkflow.dmn.specs import BusinessRuleTask
from SpiffWorkflow.spiff.parser.task_spec import BusinessRuleTaskParser
SPIFF_XSD = os.path.join(os.path.dirname(__file__), 'schema', 'spiffworkflow.xsd')
VALIDATOR = BpmnValidator(imports={'spiffworkflow': SPIFF_XSD})
class SpiffBpmnParser(BpmnDmnParser):
OVERRIDE_PARSER_CLASSES = {
@ -31,3 +37,4 @@ class SpiffBpmnParser(BpmnDmnParser):
full_tag('receiveTask'): (SpiffReceiveTaskParser, ReceiveTask),
full_tag('businessRuleTask'): (BusinessRuleTaskParser, BusinessRuleTask)
}

View File

@ -0,0 +1,64 @@
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://spiffworkflow.org/bpmn/schema/1.0/core" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="calledDecisionId" type="xsd:string"/>
<xsd:element name="instructionsForEndUser" type="xsd:string"/>
<xsd:element name="messagePayload" type="xsd:string"/>
<xsd:element name="messageVariable" type="xsd:string"/>
<xsd:element name="preScript" type="xsd:string"/>
<xsd:element name="postScript" type="xsd:string"/>
<xsd:element name="properties">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="property" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute type="xsd:string" name="name" use="optional"/>
<xsd:attribute type="xsd:string" name="value" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="unitTests">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="unitTest" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:element type="xsd:string" name="inputJson"/>
<xsd:element type="xsd:string" name="expectedOutputJson"/>
</xsd:sequence>
<xsd:attribute type="xsd:string" name="id" use="optional"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="serviceTaskOperator">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="parameters">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="parameter" maxOccurs="unbounded" minOccurs="0">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute type="xsd:string" name="id" use="optional"/>
<xsd:attribute type="xsd:string" name="type" use="optional"/>
<xsd:attribute type="xsd:string" name="value" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute type="xsd:string" name="id"/>
<xsd:attribute type="xsd:string" name="resultVariable" use="optional"/>
</xsd:complexType>
</xsd:element>
</xsd:schema>

View File

@ -39,6 +39,6 @@ class SpiffBpmnTask(BpmnSpecMixin):
self.execute_script(my_task, self.prescript)
def _on_complete_hook(self, my_task):
super()._on_complete_hook(my_task)
if self.postscript is not None:
self.execute_script(my_task, self.postscript)
super()._on_complete_hook(my_task)

View File

@ -3,6 +3,7 @@
import json
import os
import unittest
from SpiffWorkflow.bpmn.parser.BpmnParser import BpmnValidator
from SpiffWorkflow.task import TaskState
@ -18,9 +19,10 @@ class BpmnWorkflowTestCase(unittest.TestCase):
serializer = BpmnWorkflowSerializer(wf_spec_converter)
def load_workflow_spec(self, filename, process_name):
def load_workflow_spec(self, filename, process_name, validate=True):
f = os.path.join(os.path.dirname(__file__), 'data', filename)
parser = TestBpmnParser()
validator = BpmnValidator() if validate else None
parser = TestBpmnParser(validator=validator)
parser.add_bpmn_files_by_glob(f)
top_level_spec = parser.get_spec(process_name)
subprocesses = parser.get_subprocess_specs(process_name)

View File

@ -1,36 +0,0 @@
# -*- coding: utf-8 -*-
import sys
import os
import unittest
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..'))
from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase
from SpiffWorkflow.bpmn.parser.ValidationException import ValidationException
__author__ = 'kellym'
class ClashingNameTest2(BpmnWorkflowTestCase):
"""The example bpmn diagram tests both a set cardinality from user input
as well as looping over an existing array."""
def setUp(self):
pass
def loadWorkflow(self):
self.load_workflow_spec('Approvals_bad.bpmn', 'Approvals')
def testRunThroughHappy(self):
# make sure we raise an exception
# when validating a workflow with multiple
# same IDs in the BPMN workspace
self.assertRaises(ValidationException,self.loadWorkflow)
def suite():
return unittest.TestLoader().loadTestsFromTestCase(ClashingNameTest2)
if __name__ == '__main__':
unittest.TextTestRunner(verbosity=2).run(suite())

View File

@ -1,18 +1,10 @@
# -*- coding: utf-8 -*-
import sys
import os
import unittest
from SpiffWorkflow.camunda.parser.CamundaParser import CamundaParser
from SpiffWorkflow.dmn.parser.BpmnDmnParser import BpmnDmnParser
from SpiffWorkflow.spiff.parser import SpiffBpmnParser
from tests.SpiffWorkflow.bpmn.BpmnLoaderForTests import TestBpmnParser
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..'))
from SpiffWorkflow.bpmn.workflow import BpmnWorkflow
from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import BpmnWorkflowTestCase
__author__ = 'danfunk'
@ -34,6 +26,7 @@ class ProcessDependencyTest(BpmnWorkflowTestCase):
self.actual_test(SpiffBpmnParser())
def actual_test(self, parser):
# We ought to test the parsers in the packages they belong to, not here.
filename = 'call_activity_nested'
process_name = 'Level1'
base_dir = os.path.join(os.path.dirname(__file__), 'data', filename)

View File

@ -102,7 +102,7 @@
</model:process>
<model:process id="First_Approval_Wins" name="First Approval Wins">
<model:documentation></model:documentation>
<model:laneSet id="First_Approval_Wins.First Approval Wins_laneSet">
<model:laneSet id="First_Approval_Wins.First_Approval_Wins_laneSet">
<model:lane id="First_Approval_Wins.Supervisor" name="Supervisor">
<model:documentation></model:documentation>
<model:flowNodeRef>Supervisor_Approval</model:flowNodeRef>
@ -147,7 +147,7 @@
</model:process>
<model:process id="Parallel_Approvals_SP" name="Parallel Approvals SP">
<model:documentation></model:documentation>
<model:laneSet id="Parallel_Approvals_SP.Parallel Approvals SP_laneSet">
<model:laneSet id="Parallel_Approvals_SP.Parallel_Approvals_SP_laneSet">
<model:lane id="Parallel_Approvals_SP.Supervisor" name="Supervisor">
<model:documentation></model:documentation>
<model:flowNodeRef>Start3</model:flowNodeRef>

View File

@ -1,403 +0,0 @@
<?xml version="1.0" encoding="ASCII"?>
<model:definitions xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di_1="http://www.omg.org/spec/DD/20100524/DI" xmlns:model="http://www.omg.org/spec/BPMN/20100524/MODEL" exporter="BonitaSoft" exporterVersion="5.7" expressionLanguage="http://groovy.codehaus.org/" targetNamespace="http://bonitasoft.com/Approvals">
<model:collaboration id="Approvals">
<model:documentation></model:documentation>
<model:participant id="Initiator">
<model:documentation>Person who takes the first action to start the process</model:documentation>
</model:participant>
<model:participant id="_auWnIO-1EeG6ILSEFG-uBA" name="Approvals" processRef="Approvals"/>
<model:participant id="_auX1QO-1EeG6ILSEFG-uBA" name="First Approval Wins" processRef="First_Approval_Wins"/>
<model:participant id="_auYcUO-1EeG6ILSEFG-uBA" name="Parallel Approvals SP" processRef="Parallel_Approvals_SP"/>
</model:collaboration>
<model:process id="Approvals" name="Approvals">
<model:documentation></model:documentation>
<model:laneSet id="Approvals_laneSet">
<model:lane id="Approvals.Test" name="Test">
<model:documentation></model:documentation>
<model:flowNodeRef>Start1</model:flowNodeRef>
<model:flowNodeRef>First_Approval_Wins</model:flowNodeRef>
<model:flowNodeRef>End1</model:flowNodeRef>
<model:flowNodeRef>First_Approval_Wins_Done</model:flowNodeRef>
<model:flowNodeRef>Parallel_Approvals_Done</model:flowNodeRef>
<model:flowNodeRef>Parallel_SP</model:flowNodeRef>
<model:flowNodeRef>Parallel_SP_Done</model:flowNodeRef>
</model:lane>
<model:lane id="Approvals.Supervisor" name="Supervisor">
<model:documentation></model:documentation>
<model:flowNodeRef>Supervisor_Approval__P_</model:flowNodeRef>
<model:flowNodeRef>Gateway4</model:flowNodeRef>
<model:flowNodeRef>Gateway5</model:flowNodeRef>
</model:lane>
<model:lane id="Approvals.Manager" name="Manager">
<model:documentation></model:documentation>
<model:flowNodeRef>Manager_Approval__P_</model:flowNodeRef>
</model:lane>
</model:laneSet>
<model:startEvent id="Approvals.Start1" name="Start1">
<model:documentation></model:documentation>
</model:startEvent>
<model:callActivity id="Approvals.First_Approval_Wins" name="First Approval Wins" calledElement="First_Approval_Wins">
<model:documentation></model:documentation>
</model:callActivity>
<model:endEvent id="Approvals.End1" name="End1">
<model:documentation></model:documentation>
</model:endEvent>
<model:manualTask id="Approvals.First_Approval_Wins_Done" name="First Approval Wins Done">
<model:documentation></model:documentation>
</model:manualTask>
<model:manualTask id="Approvals.Parallel_Approvals_Done" name="Parallel Approvals Done">
<model:documentation></model:documentation>
</model:manualTask>
<model:callActivity id="Approvals.Parallel_SP" name="Parallel SP" calledElement="Parallel_Approvals_SP">
<model:documentation></model:documentation>
</model:callActivity>
<model:manualTask id="Approvals.Parallel_SP_Done" name="Parallel SP Done">
<model:documentation></model:documentation>
</model:manualTask>
<model:manualTask id="Approvals.Supervisor_Approval__P_" name="Supervisor Approval (P)">
<model:documentation></model:documentation>
</model:manualTask>
<model:parallelGateway id="Approvals.Gateway4" name="Gateway4">
<model:documentation></model:documentation>
</model:parallelGateway>
<model:parallelGateway id="Approvals.Gateway5" name="Gateway5">
<model:documentation></model:documentation>
</model:parallelGateway>
<model:manualTask id="Approvals.Manager_Approval__P_" name="Manager Approval (P)">
<model:documentation></model:documentation>
</model:manualTask>
<model:sequenceFlow id="_IcV3AO4CEeG6ILSEFG-uBA" sourceRef="Approvals.Start1" targetRef="Approvals.First_Approval_Wins">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="_vVCwgO4DEeG6ILSEFG-uBA" sourceRef="Approvals.First_Approval_Wins" targetRef="Approvals.First_Approval_Wins_Done">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="On_to_Parallel_Approvals1" name="On to Parallel Approvals" sourceRef="Approvals.First_Approval_Wins_Done" targetRef="Approvals.Gateway4">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="_dceXwO6YEeG6ILSEFG-uBA" sourceRef="Approvals.Gateway4" targetRef="Approvals.Manager_Approval__P_">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="_d_Hx0O6YEeG6ILSEFG-uBA" sourceRef="Approvals.Gateway4" targetRef="Approvals.Supervisor_Approval__P_">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="Approve2" name="Approve" sourceRef="Approvals.Supervisor_Approval__P_" targetRef="Approvals.Gateway5">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="On_To_Parallel_SP3" name="On To Parallel SP" sourceRef="Approvals.Parallel_Approvals_Done" targetRef="Approvals.Parallel_SP">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="Approve4" name="Approve" sourceRef="Approvals.Manager_Approval__P_" targetRef="Approvals.Gateway5">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="OK5" name="OK" sourceRef="Approvals.Parallel_SP_Done" targetRef="Approvals.End1">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="_76Vy8O6ZEeG6ILSEFG-uBA" sourceRef="Approvals.Parallel_SP" targetRef="Approvals.Parallel_SP_Done">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="_E8AnwO6aEeG6ILSEFG-uBA" sourceRef="Approvals.Gateway5" targetRef="Approvals.Parallel_Approvals_Done">
<model:documentation></model:documentation>
</model:sequenceFlow>
</model:process>
<model:process id="First_Approval_Wins" name="First Approval Wins">
<model:documentation></model:documentation>
<model:laneSet id="First_Approval_Wins.First Approval Wins_laneSet">
<model:lane id="First_Approval_Wins.Supervisor" name="Supervisor">
<model:documentation></model:documentation>
<model:flowNodeRef>Supervisor_Approval</model:flowNodeRef>
<model:flowNodeRef>Start2</model:flowNodeRef>
<model:flowNodeRef>Supervisor_Approved</model:flowNodeRef>
</model:lane>
<model:lane id="First_Approval_Wins.Manager" name="Manager">
<model:documentation></model:documentation>
<model:flowNodeRef>Manager_Approval</model:flowNodeRef>
<model:flowNodeRef>Manager_Approved</model:flowNodeRef>
</model:lane>
</model:laneSet>
<model:manualTask id="First_Approval_Wins.Supervisor_Approval" name="Supervisor Approval">
<model:documentation></model:documentation>
</model:manualTask>
<model:startEvent id="First_Approval_Wins.Start2" name="Start2">
<model:documentation></model:documentation>
</model:startEvent>
<model:endEvent id="First_Approval_Wins.Supervisor_Approved" name="Supervisor Approved">
<model:documentation></model:documentation>
<model:terminateEventDefinition id="_auX1Qe-1EeG6ILSEFG-uBA"/>
</model:endEvent>
<model:manualTask id="First_Approval_Wins.Manager_Approval" name="Manager Approval">
<model:documentation></model:documentation>
</model:manualTask>
<model:endEvent id="First_Approval_Wins.Manager_Approved" name="Manager Approved">
<model:documentation></model:documentation>
<model:terminateEventDefinition id="_auX1Qu-1EeG6ILSEFG-uBA"/>
</model:endEvent>
<model:sequenceFlow id="Approve6" name="Approve" sourceRef="First_Approval_Wins.Supervisor_Approval" targetRef="First_Approval_Wins.Supervisor_Approved">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="Approve7" name="Approve" sourceRef="First_Approval_Wins.Manager_Approval" targetRef="First_Approval_Wins.Manager_Approved">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="_CtMukO7hEeG6ILSEFG-uBA" sourceRef="First_Approval_Wins.Start2" targetRef="First_Approval_Wins.Supervisor_Approval">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="_DBwCQO7hEeG6ILSEFG-uBA" sourceRef="First_Approval_Wins.Start2" targetRef="First_Approval_Wins.Manager_Approval">
<model:documentation></model:documentation>
</model:sequenceFlow>
</model:process>
<model:process id="Parallel_Approvals_SP" name="Parallel Approvals SP">
<model:documentation></model:documentation>
<model:laneSet id="Parallel_Approvals_SP.Parallel Approvals SP_laneSet">
<model:lane id="Parallel_Approvals_SP.Supervisor" name="Supervisor">
<model:documentation></model:documentation>
<model:flowNodeRef>Start3</model:flowNodeRef>
<model:flowNodeRef>Supervisor_Approval</model:flowNodeRef>
<model:flowNodeRef>End2</model:flowNodeRef>
</model:lane>
<model:lane id="Parallel_Approvals_SP.Manager" name="Manager">
<model:documentation></model:documentation>
<model:flowNodeRef>Manager_Approval</model:flowNodeRef>
</model:lane>
<model:lane id="Parallel_Approvals_SP.Operator" name="Operator">
<model:documentation></model:documentation>
<model:flowNodeRef>Step1</model:flowNodeRef>
</model:lane>
</model:laneSet>
<model:startEvent id="Parallel_Approvals_SP.Start3" name="Start3">
<model:documentation></model:documentation>
</model:startEvent>
<model:manualTask id="Parallel_Approvals_SP.Supervisor_Approval" name="Supervisor Approval">
<model:documentation></model:documentation>
</model:manualTask>
<model:endEvent id="Parallel_Approvals_SP.End2" name="End2">
<model:documentation></model:documentation>
</model:endEvent>
<model:manualTask id="Parallel_Approvals_SP.Manager_Approval" name="Manager Approval">
<model:documentation></model:documentation>
</model:manualTask>
<model:manualTask id="Parallel_Approvals_SP.Step1" name="Operator Approval">
<model:documentation></model:documentation>
</model:manualTask>
<model:sequenceFlow id="Approve8" name="Approve" sourceRef="Parallel_Approvals_SP.Supervisor_Approval" targetRef="Parallel_Approvals_SP.End2">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="Approve9" name="Approve" sourceRef="Parallel_Approvals_SP.Manager_Approval" targetRef="Parallel_Approvals_SP.End2">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="_InMVgO6ZEeG6ILSEFG-uBA" sourceRef="Parallel_Approvals_SP.Start3" targetRef="Parallel_Approvals_SP.Step1">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="_JEeucO6ZEeG6ILSEFG-uBA" sourceRef="Parallel_Approvals_SP.Start3" targetRef="Parallel_Approvals_SP.Manager_Approval">
<model:documentation></model:documentation>
</model:sequenceFlow>
<model:sequenceFlow id="Approve10" name="Approve" sourceRef="Parallel_Approvals_SP.Step1" targetRef="Parallel_Approvals_SP.Supervisor_Approval">
<model:documentation></model:documentation>
</model:sequenceFlow>
</model:process>
<di:BPMNDiagram name="Approvals">
<di:BPMNPlane id="plane_Approvals" bpmnElement="Approvals">
<di:BPMNShape id="_Ib2u0O4CEeG6ILSEFG-uBA" bpmnElement="Approvals" isHorizontal="true">
<dc:Bounds height="724.0" width="1352.0" x="30.0" y="30.0"/>
</di:BPMNShape>
<di:BPMNShape id="_H6ddQO6XEeG6ILSEFG-uBA" bpmnElement="Test" isHorizontal="true">
<dc:Bounds height="329.0" width="1330.0" x="52.0" y="30.0"/>
</di:BPMNShape>
<di:BPMNShape id="_IcCVAO4CEeG6ILSEFG-uBA" bpmnElement="Start1">
<dc:Bounds height="34.0" width="30.0" x="92.0" y="95.0"/>
</di:BPMNShape>
<di:BPMNShape id="_R6kE8O4CEeG6ILSEFG-uBA" bpmnElement="First_Approval_Wins">
<dc:Bounds height="74.0" width="148.0" x="206.0" y="95.0"/>
</di:BPMNShape>
<di:BPMNShape id="_FRlL8O6WEeG6ILSEFG-uBA" bpmnElement="End1">
<dc:Bounds height="34.0" width="30.0" x="1045.0" y="170.0"/>
</di:BPMNShape>
<di:BPMNShape id="_8wLWIO6WEeG6ILSEFG-uBA" bpmnElement="First_Approval_Wins_Done">
<dc:Bounds height="84.0" width="168.0" x="192.0" y="190.0"/>
</di:BPMNShape>
<di:BPMNShape id="_oV8bsO6YEeG6ILSEFG-uBA" bpmnElement="Parallel_Approvals_Done">
<dc:Bounds height="74.0" width="148.0" x="522.0" y="190.0"/>
</di:BPMNShape>
<di:BPMNShape id="_Q-TKYO6ZEeG6ILSEFG-uBA" bpmnElement="Parallel_SP">
<dc:Bounds height="50.0" width="100.0" x="735.0" y="107.0"/>
</di:BPMNShape>
<di:BPMNShape id="_4T7s8O6ZEeG6ILSEFG-uBA" bpmnElement="Parallel_SP_Done">
<dc:Bounds height="74.0" width="148.0" x="865.0" y="117.0"/>
</di:BPMNShape>
<di:BPMNShape id="_rvrNEO6XEeG6ILSEFG-uBA" bpmnElement="Supervisor" isHorizontal="true">
<dc:Bounds height="250.0" width="1330.0" x="52.0" y="359.0"/>
</di:BPMNShape>
<di:BPMNShape id="_8zU7UO6XEeG6ILSEFG-uBA" bpmnElement="Supervisor_Approval__P_">
<dc:Bounds height="83.0" width="166.0" x="403.0" y="459.0"/>
</di:BPMNShape>
<di:BPMNShape id="_aVYD8O6YEeG6ILSEFG-uBA" bpmnElement="Gateway4">
<dc:Bounds height="43.0" width="43.0" x="211.0" y="408.0"/>
</di:BPMNShape>
<di:BPMNShape id="_CesQwO6aEeG6ILSEFG-uBA" bpmnElement="Gateway5">
<dc:Bounds height="43.0" width="43.0" x="613.0" y="479.0"/>
</di:BPMNShape>
<di:BPMNShape id="_vgLDMO6XEeG6ILSEFG-uBA" bpmnElement="Manager" isHorizontal="true">
<dc:Bounds height="145.0" width="1330.0" x="52.0" y="609.0"/>
</di:BPMNShape>
<di:BPMNShape id="_JXN5sO6YEeG6ILSEFG-uBA" bpmnElement="Manager_Approval__P_">
<dc:Bounds height="60.0" width="120.0" x="419.0" y="639.0"/>
</di:BPMNShape>
<di:BPMNEdge id="_IcWeEO4CEeG6ILSEFG-uBA" bpmnElement="_IcV3AO4CEeG6ILSEFG-uBA">
<di_1:waypoint x="122.0" y="122.0"/>
<di_1:waypoint x="206.0" y="122.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_vVDXkO4DEeG6ILSEFG-uBA" bpmnElement="_vVCwgO4DEeG6ILSEFG-uBA">
<di_1:waypoint x="311.0" y="169.0"/>
<di_1:waypoint x="311.0" y="190.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_DYxlUO6YEeG6ILSEFG-uBA" bpmnElement="On_to_Parallel_Approvals">
<di_1:waypoint x="240.0" y="274.0"/>
<di_1:waypoint x="240.0" y="415.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_dcfl4O6YEeG6ILSEFG-uBA" bpmnElement="_dceXwO6YEeG6ILSEFG-uBA">
<di_1:waypoint x="236.0" y="447.0"/>
<di_1:waypoint x="236.0" y="668.0"/>
<di_1:waypoint x="419.0" y="668.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_d_I_8O6YEeG6ILSEFG-uBA" bpmnElement="_d_Hx0O6YEeG6ILSEFG-uBA">
<di_1:waypoint x="248.0" y="434.0"/>
<di_1:waypoint x="325.0" y="434.0"/>
<di_1:waypoint x="325.0" y="480.0"/>
<di_1:waypoint x="403.0" y="480.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_vsd9UO6YEeG6ILSEFG-uBA" bpmnElement="Approve">
<di_1:waypoint x="569.0" y="487.0"/>
<di_1:waypoint x="592.0" y="487.0"/>
<di_1:waypoint x="592.0" y="496.0"/>
<di_1:waypoint x="616.0" y="496.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_yTd0wO6YEeG6ILSEFG-uBA" bpmnElement="On_To_Parallel_SP">
<di_1:waypoint x="670.0" y="194.0"/>
<di_1:waypoint x="720.0" y="194.0"/>
<di_1:waypoint x="720.0" y="173.0"/>
<di_1:waypoint x="745.0" y="173.0"/>
<di_1:waypoint x="745.0" y="157.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_34HwIO6YEeG6ILSEFG-uBA" bpmnElement="Approve">
<di_1:waypoint x="539.0" y="668.0"/>
<di_1:waypoint x="626.0" y="668.0"/>
<di_1:waypoint x="626.0" y="514.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_UUS10O6ZEeG6ILSEFG-uBA" bpmnElement="OK">
<di_1:waypoint x="1013.0" y="180.0"/>
<di_1:waypoint x="1045.0" y="180.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_76XBEO6ZEeG6ILSEFG-uBA" bpmnElement="_76Vy8O6ZEeG6ILSEFG-uBA">
<di_1:waypoint x="835.0" y="135.0"/>
<di_1:waypoint x="850.0" y="135.0"/>
<di_1:waypoint x="850.0" y="137.0"/>
<di_1:waypoint x="865.0" y="137.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_E8B14O6aEeG6ILSEFG-uBA" bpmnElement="_E8AnwO6aEeG6ILSEFG-uBA">
<di_1:waypoint x="628.0" y="485.0"/>
<di_1:waypoint x="628.0" y="264.0"/>
</di:BPMNEdge>
<di:BPMNShape id="_R6hBoO4CEeG6ILSEFG-uBA" bpmnElement="First_Approval_Wins" isHorizontal="true">
<dc:Bounds height="500.0" width="1352.0" x="30.0" y="774.0"/>
</di:BPMNShape>
<di:BPMNShape id="_sDQsIO4CEeG6ILSEFG-uBA" bpmnElement="Supervisor" isHorizontal="true">
<dc:Bounds height="250.0" width="1330.0" x="52.0" y="774.0"/>
</di:BPMNShape>
<di:BPMNShape id="_R6vrIe4CEeG6ILSEFG-uBA" bpmnElement="Supervisor_Approval">
<dc:Bounds height="50.0" width="100.0" x="320.0" y="858.0"/>
</di:BPMNShape>
<di:BPMNShape id="_VgS1gO4CEeG6ILSEFG-uBA" bpmnElement="Start2">
<dc:Bounds height="34.0" width="30.0" x="134.0" y="843.0"/>
</di:BPMNShape>
<di:BPMNShape id="_jja8kO4DEeG6ILSEFG-uBA" bpmnElement="Supervisor_Approved">
<dc:Bounds height="34.0" width="30.0" x="538.0" y="876.0"/>
</di:BPMNShape>
<di:BPMNShape id="_ttNsgO4CEeG6ILSEFG-uBA" bpmnElement="Manager" isHorizontal="true">
<dc:Bounds height="250.0" width="1330.0" x="52.0" y="1024.0"/>
</di:BPMNShape>
<di:BPMNShape id="_jf_DgO4CEeG6ILSEFG-uBA" bpmnElement="Manager_Approval">
<dc:Bounds height="50.0" width="100.0" x="304.0" y="1124.0"/>
</di:BPMNShape>
<di:BPMNShape id="_oUPnQO4DEeG6ILSEFG-uBA" bpmnElement="Manager_Approved">
<dc:Bounds height="34.0" width="30.0" x="522.0" y="1134.0"/>
</di:BPMNShape>
<di:BPMNEdge id="_mAyW4O4DEeG6ILSEFG-uBA" bpmnElement="Approve">
<di_1:waypoint x="420.0" y="886.0"/>
<di_1:waypoint x="479.0" y="886.0"/>
<di_1:waypoint x="479.0" y="892.0"/>
<di_1:waypoint x="538.0" y="892.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_qIrZUO4DEeG6ILSEFG-uBA" bpmnElement="Approve">
<di_1:waypoint x="404.0" y="1153.0"/>
<di_1:waypoint x="463.0" y="1153.0"/>
<di_1:waypoint x="463.0" y="1147.0"/>
<di_1:waypoint x="522.0" y="1147.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_CtMuku7hEeG6ILSEFG-uBA" bpmnElement="_CtMukO7hEeG6ILSEFG-uBA">
<di_1:waypoint x="164.0" y="872.0"/>
<di_1:waypoint x="242.0" y="872.0"/>
<di_1:waypoint x="242.0" y="880.0"/>
<di_1:waypoint x="320.0" y="880.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_DBxQYO7hEeG6ILSEFG-uBA" bpmnElement="_DBwCQO7hEeG6ILSEFG-uBA">
<di_1:waypoint x="149.0" y="877.0"/>
<di_1:waypoint x="149.0" y="1149.0"/>
<di_1:waypoint x="304.0" y="1149.0"/>
</di:BPMNEdge>
<di:BPMNShape id="_Zk-u8O4uEeG6ILSEFG-uBA" bpmnElement="Parallel_Approvals_SP" isHorizontal="true">
<dc:Bounds height="630.0" width="1352.0" x="30.0" y="1294.0"/>
</di:BPMNShape>
<di:BPMNShape id="_f_FroO4uEeG6ILSEFG-uBA" bpmnElement="Supervisor" isHorizontal="true">
<dc:Bounds height="280.0" width="1330.0" x="52.0" y="1394.0"/>
</di:BPMNShape>
<di:BPMNShape id="_uEKI4O4uEeG6ILSEFG-uBA" bpmnElement="Start3">
<dc:Bounds height="34.0" width="30.0" x="134.0" y="1530.0"/>
</di:BPMNShape>
<di:BPMNShape id="_vTJEgO4uEeG6ILSEFG-uBA" bpmnElement="Supervisor_Approval">
<dc:Bounds height="50.0" width="100.0" x="493.0" y="1522.0"/>
</di:BPMNShape>
<di:BPMNShape id="_K4QgkO6WEeG6ILSEFG-uBA" bpmnElement="End2">
<dc:Bounds height="34.0" width="30.0" x="799.0" y="1530.0"/>
</di:BPMNShape>
<di:BPMNShape id="_j4eYAO4uEeG6ILSEFG-uBA" bpmnElement="Manager" isHorizontal="true">
<dc:Bounds height="250.0" width="1330.0" x="52.0" y="1674.0"/>
</di:BPMNShape>
<di:BPMNShape id="_y4gBoO4uEeG6ILSEFG-uBA" bpmnElement="Manager_Approval">
<dc:Bounds height="50.0" width="100.0" x="364.0" y="1795.0"/>
</di:BPMNShape>
<di:BPMNShape id="_RkTswO7hEeG6ILSEFG-uBA" bpmnElement="Operator" isHorizontal="true">
<dc:Bounds height="100.0" width="1330.0" x="52.0" y="1294.0"/>
</di:BPMNShape>
<di:BPMNShape id="_VVzBYO7hEeG6ILSEFG-uBA" bpmnElement="Step1">
<dc:Bounds height="50.0" width="100.0" x="364.0" y="1324.0"/>
</di:BPMNShape>
<di:BPMNEdge id="_-dnqoO4uEeG6ILSEFG-uBA" bpmnElement="Approve">
<di_1:waypoint x="593.0" y="1554.0"/>
<di_1:waypoint x="799.0" y="1554.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="__RQHAO4uEeG6ILSEFG-uBA" bpmnElement="Approve">
<di_1:waypoint x="464.0" y="1825.0"/>
<di_1:waypoint x="631.0" y="1825.0"/>
<di_1:waypoint x="631.0" y="1558.0"/>
<di_1:waypoint x="799.0" y="1558.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_InOKsO6ZEeG6ILSEFG-uBA" bpmnElement="_InMVgO6ZEeG6ILSEFG-uBA">
<di_1:waypoint x="164.0" y="1558.0"/>
<di_1:waypoint x="264.0" y="1558.0"/>
<di_1:waypoint x="264.0" y="1365.0"/>
<di_1:waypoint x="364.0" y="1365.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_JEgjoO6ZEeG6ILSEFG-uBA" bpmnElement="_JEeucO6ZEeG6ILSEFG-uBA">
<di_1:waypoint x="149.0" y="1564.0"/>
<di_1:waypoint x="149.0" y="1634.0"/>
<di_1:waypoint x="307.0" y="1634.0"/>
<di_1:waypoint x="307.0" y="1812.0"/>
<di_1:waypoint x="364.0" y="1812.0"/>
</di:BPMNEdge>
<di:BPMNEdge id="_W9jpYO7hEeG6ILSEFG-uBA" bpmnElement="Approve">
<di_1:waypoint x="464.0" y="1356.0"/>
<di_1:waypoint x="532.0" y="1356.0"/>
<di_1:waypoint x="532.0" y="1522.0"/>
</di:BPMNEdge>
</di:BPMNPlane>
</di:BPMNDiagram>
</model:definitions>

View File

@ -2,31 +2,31 @@
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_0qmxumb" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.0.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.17.0">
<bpmn:collaboration id="my_collaboration">
<bpmn:participant id="buddy" name="Buddy" processRef="process_buddy" />
<bpmn:participant id="Person" name="Person" processRef="random_person_process" />
<bpmn:messageFlow id="love_letter_flow" name="Love Letter Flow" sourceRef="ActivitySendLetter" targetRef="Person" />
<bpmn:messageFlow id="response_flow" name="response flow" sourceRef="Person" targetRef="EventReceiveLetter" />
<bpmn:correlationKey name="lover">
<bpmn:correlationPropertyRef>lover_name</bpmn:correlationPropertyRef>
</bpmn:correlationKey>
</bpmn:collaboration>
<bpmn:message id="love_letter" name="Love Letter" />
<bpmn:message id="love_letter_response" name="Love Letter Response" />
<bpmn:correlationProperty id="lover_name" name="Lover&#39;s Name">
<bpmn:correlationPropertyRetrievalExpression messageRef="love_letter">
<bpmn:formalExpression>lover_name</bpmn:formalExpression>
<bpmn:messagePath>lover_name</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
<bpmn:correlationPropertyRetrievalExpression messageRef="love_letter_response">
<bpmn:formalExpression>from_name</bpmn:formalExpression>
<bpmn:messagePath>from_name</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmn:process id="process_buddy" name="Process Buddy" isExecutable="true">
<bpmn:startEvent id="StartEvent_1">
<bpmn:outgoing>Flow_1bl6jeh</bpmn:outgoing>
@ -49,12 +49,12 @@
</bpmn:process>
<bpmn:process id="random_person_process" name="Process" isExecutable="false" />
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="my_collaboration">
<bpmndi:BPMNShape id="Participant_12ffz3p_di" bpmnElement="buddy" isHorizontal="true">
@ -109,4 +109,4 @@
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
</bpmn:definitions>

View File

@ -9,10 +9,10 @@
</bpmn:collaboration>
<bpmn:correlationProperty id="process_id" name="Test Correlation">
<bpmn:correlationPropertyRetrievalExpression messageRef="Message_19nm5f5">
<bpmn:formalExpression>task_num</bpmn:formalExpression>
<bpmn:messagePath>task_num</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
<bpmn:correlationPropertyRetrievalExpression messageRef="Message_0fc1gu7">
<bpmn:formalExpression>init_id</bpmn:formalExpression>
<bpmn:messagePath>init_id</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmn:process id="proc_1" name="Process 1" isExecutable="true">

View File

@ -13,18 +13,18 @@
</bpmn:collaboration>
<bpmn:correlationProperty id="process_id" name="Test Correlation">
<bpmn:correlationPropertyRetrievalExpression messageRef="Message_19nm5f5">
<bpmn:formalExpression>task_num</bpmn:formalExpression>
<bpmn:messagePath>task_num</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
<bpmn:correlationPropertyRetrievalExpression messageRef="Message_0fc1gu7">
<bpmn:formalExpression>init_id</bpmn:formalExpression>
<bpmn:messagePath>init_id</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmn:correlationProperty id="task_id" name="Test Correlation">
<bpmn:correlationPropertyRetrievalExpression messageRef="Message_0hr1xdn">
<bpmn:formalExpression>task_num</bpmn:formalExpression>
<bpmn:messagePath>task_num</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
<bpmn:correlationPropertyRetrievalExpression messageRef="Message_0z3cr5h">
<bpmn:formalExpression>subprocess</bpmn:formalExpression>
<bpmn:messagePath>subprocess</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmn:process id="proc_1" name="Process 1" isExecutable="true">

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_19o7vxg" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.11.1" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.17.0">
<bpmn:process id="Process" isExecutable="true">
<bpmn:ioSpecification />
<bpmn:dataObject id="obj_1" />
<bpmn:startEvent id="Event_0kmwi7u">
<bpmn:outgoing>Flow_18858hr</bpmn:outgoing>

View File

@ -9,6 +9,18 @@
<dataInput id="in_2" name="input 2" />
<dataOutput id="out_1" name="output 1" />
<dataOutput id="out_2" name="output 2" />
<!-- creating input sets and output sets is way to define these
as a required set of inputs or outputs that must all
appear together -->
<inputSet name="Inputs" id="INS_1">
<dataInputRefs>id_1</dataInputRefs>
<dataInputRefs>id_2</dataInputRefs>
</inputSet>
<outputSet name="Outputs" id="OUTS_1">
<dataOutputRefs>out_1</dataOutputRefs>
<dataOutputRefs>out_2</dataOutputRefs>
</outputSet>
<outputSet name="Outputs" id="ID_8"/>
</ioSpecification>
<startEvent id="Event_1rtivo5">
<outgoing>Flow_0n038fc</outgoing>

View File

@ -11,8 +11,8 @@ __author__ = 'matth'
class ActionManagementTest(BpmnWorkflowTestCase):
START_TIME_DELTA=0.01
FINISH_TIME_DELTA=0.02
START_TIME_DELTA=0.05
FINISH_TIME_DELTA=0.10
def now_plus_seconds(self, seconds):
return datetime.datetime.now() + datetime.timedelta(seconds=seconds)
@ -27,7 +27,7 @@ class ActionManagementTest(BpmnWorkflowTestCase):
self.assertEqual(1, len(self.workflow.get_tasks(TaskState.READY)))
self.workflow.get_tasks(TaskState.READY)[0].set_data(
start_time=start_time, finish_time=finish_time)
def testRunThroughHappy(self):
self.do_next_exclusive_step("Review Action", choice='Approve')
self.workflow.do_engine_steps()

View File

@ -41,7 +41,7 @@ def track_workflow(wf_spec, completed_set):
class CallActivityEscalationTest(BpmnWorkflowTestCase):
def setUp(self):
self.spec, subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'CallActivity-Escalation-Test')
self.spec, subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'CallActivity-Escalation-Test', False)
self.workflow = BpmnWorkflow(self.spec, subprocesses)
def testShouldEscalate(self):

View File

@ -13,7 +13,7 @@ __author__ = 'matth'
class MessageInterruptsSpTest(BpmnWorkflowTestCase):
def setUp(self):
self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Message Interrupts SP')
self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Message Interrupts SP', False)
def testRunThroughHappySaveAndRestore(self):

View File

@ -13,7 +13,7 @@ __author__ = 'matth'
class MessageInterruptsTest(BpmnWorkflowTestCase):
def setUp(self):
self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Test Workflows')
self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Test Workflows', False)
def testRunThroughHappySaveAndRestore(self):

View File

@ -13,7 +13,7 @@ __author__ = 'matth'
class MessageNonInterruptTest(BpmnWorkflowTestCase):
def setUp(self):
self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Test Workflows')
self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Test Workflows', False)
def testRunThroughHappySaveAndRestore(self):

View File

@ -13,7 +13,7 @@ __author__ = 'matth'
class MessageNonInterruptsSpTest(BpmnWorkflowTestCase):
def setUp(self):
self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Message Non Interrupt SP')
self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Message Non Interrupt SP', False)
def testRunThroughHappySaveAndRestore(self):

View File

@ -13,7 +13,7 @@ __author__ = 'matth'
class MessagesTest(BpmnWorkflowTestCase):
def setUp(self):
self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Test Workflows')
self.spec, self.subprocesses = self.load_workflow_spec('Test-Workflows/*.bpmn20.xml', 'Test Workflows', False)
def testRunThroughHappy(self):

View File

@ -1,8 +1,7 @@
from SpiffWorkflow.bpmn.parser.util import full_tag
from SpiffWorkflow.camunda.specs.UserTask import UserTask
from SpiffWorkflow.camunda.parser.CamundaParser import CamundaParser
from SpiffWorkflow.camunda.parser.UserTaskParser import UserTaskParser
from SpiffWorkflow.camunda.parser.business_rule_task import BusinessRuleTaskParser
from SpiffWorkflow.camunda.parser.task_spec import UserTaskParser, BusinessRuleTaskParser
from SpiffWorkflow.dmn.specs.BusinessRuleTask import BusinessRuleTask
from .BaseTestCase import BaseTestCase

View File

@ -1,6 +1,6 @@
import unittest
from SpiffWorkflow.camunda.parser.UserTaskParser import UserTaskParser
from SpiffWorkflow.camunda.parser.task_spec import UserTaskParser
from tests.SpiffWorkflow.camunda.BaseTestCase import BaseTestCase

View File

@ -1,28 +0,0 @@
import unittest
from SpiffWorkflow.camunda.parser.UserTaskParser import UserTaskParser
from SpiffWorkflow.camunda.specs.UserTask import UserTask
from SpiffWorkflow.camunda.parser.CamundaParser import CamundaParser
class CamundaParserTest(unittest.TestCase):
CORRELATE = CamundaParser
def setUp(self):
self.parser = CamundaParser()
def test_overrides(self):
expected_key = "{http://www.omg.org/spec/BPMN/20100524/MODEL}userTask"
self.assertIn(expected_key,
self.parser.OVERRIDE_PARSER_CLASSES)
self.assertEqual((UserTaskParser, UserTask),
self.parser.OVERRIDE_PARSER_CLASSES.get(expected_key))
def suite():
return unittest.TestLoader().loadTestsFromTestCase(CamundaParserTest)
if __name__ == '__main__':
unittest.TextTestRunner(verbosity=2).run(suite())

View File

@ -4,7 +4,7 @@ from lxml import etree
from SpiffWorkflow.bpmn.PythonScriptEngine import Box
from SpiffWorkflow.dmn.engine.DMNEngine import DMNEngine
from SpiffWorkflow.dmn.parser.DMNParser import DMNParser
from SpiffWorkflow.dmn.parser.DMNParser import DMNParser, get_dmn_ns
class Workflow:
@ -33,7 +33,7 @@ class DecisionRunner:
with open(fn) as fh:
node = etree.parse(fh)
self.dmnParser = DMNParser(None, node.getroot())
self.dmnParser = DMNParser(None, node.getroot(), get_dmn_ns(node.getroot()))
self.dmnParser.parse()
decision = self.dmnParser.decision

View File

@ -12,7 +12,7 @@ class DmnVersionTest(BpmnWorkflowTestCase):
def testLoad(self):
dmn = os.path.join(os.path.dirname(__file__), 'data',
'dmn_version_20191111_test.dmn')
'dmn_version_20151101_test.dmn')
self.assertIsNone(self.parser.add_dmn_file(dmn))

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import os
from SpiffWorkflow.spiff.parser import SpiffBpmnParser
from SpiffWorkflow.spiff.parser import SpiffBpmnParser, VALIDATOR
from SpiffWorkflow.spiff.serializer import NoneTaskConverter, \
ManualTaskConverter, UserTaskConverter, ScriptTaskConverter, \
SubWorkflowTaskConverter, TransactionSubprocessConverter, \
@ -28,9 +28,9 @@ class BaseTestCase(BpmnWorkflowTestCase):
serializer = BpmnWorkflowSerializer(wf_spec_converter)
def load_workflow_spec(self, filename, process_name, dmn_filename=None):
def load_workflow_spec(self, filename, process_name, dmn_filename=None, validate=True):
bpmn = os.path.join(os.path.dirname(__file__), 'data', filename)
parser = SpiffBpmnParser()
parser = SpiffBpmnParser(validator=VALIDATOR if validate else None)
parser.add_bpmn_files_by_glob(bpmn)
if dmn_filename is not None:
dmn = os.path.join(os.path.dirname(__file__), 'data', 'dmn', dmn_filename)

View File

@ -5,53 +5,51 @@
<bpmn:outgoing>Flow_0lrg65h</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:sequenceFlow id="Flow_0lrg65h" sourceRef="StartEvent_1" targetRef="Activity_10k4dgb" />
<bpmn:endEvent id="Event_184erzz">
<bpmn:incoming>Flow_0l8nhib</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_0l8nhib" sourceRef="Activity_0ux7vpx" targetRef="Event_184erzz" />
<bpmn:businessRuleTask id="Activity_0ux7vpx" name="Business Rules" scriptFormat="python" script="question = &#34;X&#34;">
<bpmn:extensionElements>
<spiffworkflow:calledDecisionId>decision_1</spiffworkflow:calledDecisionId>
<spiffworkflow:preScript />
<spiffworkflow:postScript />
</bpmn:extensionElements>
<bpmn:incoming>Flow_1109ldv</bpmn:incoming>
<bpmn:outgoing>Flow_0l8nhib</bpmn:outgoing>
</bpmn:businessRuleTask>
<bpmn:sequenceFlow id="Flow_1109ldv" sourceRef="Activity_10k4dgb" targetRef="Activity_0ux7vpx" />
<bpmn:scriptTask id="Activity_10k4dgb" name="Set BR Variable">
<bpmn:incoming>Flow_0lrg65h</bpmn:incoming>
<bpmn:outgoing>Flow_1109ldv</bpmn:outgoing>
<bpmn:outgoing>Flow_0m1tt51</bpmn:outgoing>
<bpmn:script>question = "X"</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="Flow_0m1tt51" sourceRef="Activity_10k4dgb" targetRef="Activity_0diq2z1" />
<bpmn:businessRuleTask id="Activity_0diq2z1" name="Business Rules">
<bpmn:extensionElements>
<spiffworkflow:calledDecisionId>decision_1</spiffworkflow:calledDecisionId>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0m1tt51</bpmn:incoming>
<bpmn:outgoing>Flow_19vr2vt</bpmn:outgoing>
</bpmn:businessRuleTask>
<bpmn:endEvent id="Event_0cqyhox">
<bpmn:incoming>Flow_19vr2vt</bpmn:incoming>
</bpmn:endEvent>
<bpmn:sequenceFlow id="Flow_19vr2vt" sourceRef="Activity_0diq2z1" targetRef="Event_0cqyhox" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_bd2e724">
<bpmndi:BPMNEdge id="Flow_1109ldv_di" bpmnElement="Flow_1109ldv">
<di:waypoint x="370" y="177" />
<di:waypoint x="430" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0l8nhib_di" bpmnElement="Flow_0l8nhib">
<di:waypoint x="530" y="177" />
<di:waypoint x="612" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0lrg65h_di" bpmnElement="Flow_0lrg65h">
<di:waypoint x="215" y="177" />
<di:waypoint x="270" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1">
<dc:Bounds x="179" y="159" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_184erzz_di" bpmnElement="Event_184erzz">
<dc:Bounds x="612" y="159" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_070a8q9_di" bpmnElement="Activity_0ux7vpx">
<dc:Bounds x="430" y="137" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1emp7lc_di" bpmnElement="Activity_10k4dgb">
<dc:Bounds x="270" y="137" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_08xsh1p_di" bpmnElement="Activity_0diq2z1">
<dc:Bounds x="430" y="137" width="100" height="80" />
<bpmndi:BPMNLabel />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_0cqyhox_di" bpmnElement="Event_0cqyhox">
<dc:Bounds x="592" y="159" width="36" height="36" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="Flow_0lrg65h_di" bpmnElement="Flow_0lrg65h">
<di:waypoint x="215" y="177" />
<di:waypoint x="270" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0m1tt51_di" bpmnElement="Flow_0m1tt51">
<di:waypoint x="370" y="177" />
<di:waypoint x="430" y="177" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_19vr2vt_di" bpmnElement="Flow_19vr2vt">
<di:waypoint x="530" y="177" />
<di:waypoint x="592" y="177" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>

View File

@ -9,10 +9,10 @@
</bpmn:collaboration>
<bpmn:correlationProperty id="process_id" name="Test Correlation">
<bpmn:correlationPropertyRetrievalExpression messageRef="Message_19nm5f5">
<bpmn:formalExpression>num</bpmn:formalExpression>
<bpmn:messagePath>num</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
<bpmn:correlationPropertyRetrievalExpression messageRef="Message_0fc1gu7">
<bpmn:formalExpression>init_id</bpmn:formalExpression>
<bpmn:messagePath>init_id</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmn:message id="Message_19nm5f5" name="init_proc_2">

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:spiffworkflow="http://spiffworkflow.org/bpmn/schema/1.0/core" id="Definitions_96f6665" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.0.0-dev">
<bpmn:collaboration id="Collaboration_0oye1os" messages="[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]">
<bpmn:collaboration id="Collaboration_0oye1os">
<bpmn:participant id="message_initiator" name="Message Initiator" processRef="message_send_process" />
<bpmn:participant id="message-receiver-one" name="Message Receiver One" />
<bpmn:participant id="message-receiver-two" name="Message Receiver Two" />
@ -19,18 +19,18 @@
</bpmn:collaboration>
<bpmn:correlationProperty id="mcp_topica_one" name="MCP TopicA One">
<bpmn:correlationPropertyRetrievalExpression messageRef="message_send_one">
<bpmn:formalExpression>topica_one</bpmn:formalExpression>
<bpmn:messagePath>topica_one</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
<bpmn:correlationPropertyRetrievalExpression messageRef="message_response_one">
<bpmn:formalExpression>payload_var_one.topica</bpmn:formalExpression>
<bpmn:messagePath>payload_var_one.topica</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmn:correlationProperty id="mcp_topicb_one" name="MCP TopicB_one">
<bpmn:correlationPropertyRetrievalExpression messageRef="message_send_one">
<bpmn:formalExpression>topicb_one</bpmn:formalExpression>
<bpmn:messagePath>topicb_one</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
<bpmn:correlationPropertyRetrievalExpression messageRef="message_response_one">
<bpmn:formalExpression>payload_var_one.topicb</bpmn:formalExpression>
<bpmn:messagePath>payload_var_one.topicb</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmn:process id="message_send_process" name="Message Send Process" isExecutable="true">
@ -117,18 +117,18 @@ del time</bpmn:script>
</bpmn:message>
<bpmn:correlationProperty id="mcp_topica_two" name="MCP Topica Two">
<bpmn:correlationPropertyRetrievalExpression messageRef="message_send_two">
<bpmn:formalExpression>topica_two</bpmn:formalExpression>
<bpmn:messagePath>topica_two</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
<bpmn:correlationPropertyRetrievalExpression messageRef="message_response_two">
<bpmn:formalExpression>topica_two</bpmn:formalExpression>
<bpmn:messagePath>topica_two</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmn:correlationProperty id="mcp_topicb_two" name="MCP Topicb Two">
<bpmn:correlationPropertyRetrievalExpression messageRef="message_send_two">
<bpmn:formalExpression>topicb_two</bpmn:formalExpression>
<bpmn:messagePath>topicb_two</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
<bpmn:correlationPropertyRetrievalExpression messageRef="message_response_two">
<bpmn:formalExpression>topicb_two</bpmn:formalExpression>
<bpmn:messagePath>topicb_two</bpmn:messagePath>
</bpmn:correlationPropertyRetrievalExpression>
</bpmn:correlationProperty>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:spiffworkflow="http://spiffworkflow.org/bpmn/schema/1.0/core" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_19o7vxg" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.0.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.17.0">
<bpmn:process id="Process_1" isExecutable="true">
<bpmn:ioSpecification />
<bpmn:startEvent id="Event_1ftsuzw">
<bpmn:outgoing>Flow_1hjrex4</bpmn:outgoing>
</bpmn:startEvent>

View File

@ -4,6 +4,12 @@
<bpmn:ioSpecification>
<bpmn:dataInput id="in_data" name="Input" />
<bpmn:dataOutput id="out_data" name="Output" />
<bpmn:inputSet>
<bpmn:dataInputRefs>in_data</bpmn:dataInputRefs>
</bpmn:inputSet>
<bpmn:outputSet>
<bpmn:dataOutputRefs>out_data</bpmn:dataOutputRefs>
</bpmn:outputSet>
</bpmn:ioSpecification>
<bpmn:startEvent id="Event_1ftsuzw">
<bpmn:outgoing>Flow_1a4nkhi</bpmn:outgoing>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:spiffworkflow="http://spiffworkflow.org/bpmn/schema/1.0/core" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_19o7vxg" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.0.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.17.0">
<bpmn:process id="Process_1" isExecutable="true">
<bpmn:ioSpecification />
<bpmn:startEvent id="Event_1ftsuzw">
<bpmn:outgoing>Flow_1hjrex4</bpmn:outgoing>
</bpmn:startEvent>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:spiffworkflow="http://spiffworkflow.org/bpmn/schema/1.0/core" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_19o7vxg" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.0.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.17.0">
<bpmn:process id="parent" isExecutable="true">
<bpmn:ioSpecification />
<bpmn:startEvent id="Event_1i37yhp">
<bpmn:outgoing>Flow_1e5oj0e</bpmn:outgoing>
</bpmn:startEvent>

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:spiffworkflow="http://spiffworkflow.org/bpmn/schema/1.0/core" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_19o7vxg" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.0.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.17.0">
<bpmn:process id="Process_1" isExecutable="true">
<bpmn:ioSpecification />
<bpmn:startEvent id="Event_1ftsuzw">
<bpmn:outgoing>Flow_1hjrex4</bpmn:outgoing>
</bpmn:startEvent>
@ -16,7 +15,7 @@
<spiffworkflow:property name="formJsonSchemaFilename" value="my_json_jschema.json" />
<spiffworkflow:property name="formUiSchemaFilename" value="my_ui_jschema.json" />
</spiffworkflow:properties>
</bpmn:extensionElements>3
</bpmn:extensionElements>
<bpmn:incoming>Flow_1hjrex4</bpmn:incoming>
<bpmn:outgoing>Flow_1vlqqxh</bpmn:outgoing>
</bpmn:userTask>