rectify-schematron.xml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <sch:schema xmlns:sch="http://www.ascc.net/xml/schematron">
  3. <sch:ns uri="http://www.omg.org/spec/BPMN/20100524/MODEL" prefix="bpmn"/>
  4. <sch:ns uri="http://www.omg.org/spec/BPMN/20100524/DI" prefix="bpmndi"/>
  5. <sch:ns uri="http://www.omg.org/spec/DD/20100524/DC" prefix="dc"/>
  6. <sch:ns uri="http://www.omg.org/spec/DD/20100524/DI" prefix="di"/>
  7. <sch:ns uri="http://bpmn.io/schema/bpmn/biocolor/1.0" prefix="bioc"/>
  8. <sch:pattern>
  9. <sch:title>Unique Ids</sch:title>
  10. <sch:rule context="*[@id]">
  11. <sch:assert test="not(preceding::*[@id=current()/@id][1]">Id attributes should be unique in a document.</sch:assert>
  12. </sch:rule>
  13. </sch:pattern>
  14. <sch:pattern name="lane id">
  15. <sch:rule context="bpmn:lane">
  16. <sch:assert test="@id">The element lane must have an id attribute</sch:assert>
  17. </sch:rule>
  18. </sch:pattern>
  19. <sch:pattern name="sequenceFlow id">
  20. <sch:rule context="bpmn:lane">
  21. <sch:assert test="@id">The element sequenceFlow must have an id attribute</sch:assert>
  22. </sch:rule>
  23. </sch:pattern>
  24. <sch:pattern name="id obligatory for other elements">
  25. <sch:rule context="bpmn:[@intermediateCatchEvent,@parallelGateway,@exclusiveGateway,@inclusiveGateway,@startEvent,@endEvent,@task">
  26. <sch:assert test="@id">The element intermediateCatchEvent, parallelGateway, exclusiveGateway, inclusiveGateway, startEvent, endEvent, task must have an id attribute</sch:assert>
  27. </sch:rule>
  28. </sch:pattern>
  29. <sch:pattern name="Check source-target constraints">
  30. <sch:rule context="bpmn:sequenceFlow">
  31. <sch:assert test="(@sourceRef = '*' and @targetRef = '*') and @sourceRef != ''">Check the target exists.</sch:assert>
  32. </sch:rule>
  33. </sch:pattern>
  34. </sch:schema>