pub fn load(input: &str) -> Result<Document, Error>Expand description
detect + parse. Process text and compact JSON are expanded (and laid out) into a
BPMN or DMN document. Expansion does not apply the Camunda 8 deploy gate, so a draft
still loads; run the lint crate to find what Zeebe would refuse.
Examples found in repository?
More examples
examples/lint_report.rs (line 14)
8fn main() -> Result<(), Error> {
9 // A start event with nothing after it.
10 let xml = r#"<?xml version="1.0" encoding="UTF-8"?>
11<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" id="D" targetNamespace="http://bpmn.io/schema/bpmn">
12 <bpmn:process id="p" isExecutable="true"><bpmn:startEvent id="s"/></bpmn:process>
13</bpmn:definitions>"#;
14 let Document::Bpmn(definitions) = load(xml)? else {
15 unreachable!("the input is BPMN");
16 };
17 let report = lint_diagram(&definitions, LintOptions::default());
18 println!(
19 "{}",
20 to_text(
21 &report,
22 &TextStyle {
23 color: false,
24 max: 10
25 }
26 )
27 );
28 println!("{}", to_markdown(&report));
29 println!("{}", to_slack_mrkdwn(&report));
30 Ok(())
31}