Skip to content

parse

Parse a BPMN file.

CLASS DESCRIPTION
ParseContext

Context for parsing BPMN elements from XML dictionaries.

ParseResult

Result for parsing a BPMN file.

Parser

A parser for BPMN files.

Reference

A reference to an element that has not been fully processed yet.

Classes

ParseContext

ParseContext()

Context for parsing BPMN elements from XML dictionaries.

METHOD DESCRIPTION
add_element

Add a processed element.

add_reference

Add an unresolved reference.

ATTRIBUTE DESCRIPTION
elements_by_id

A mapping from element ID to element instance.

TYPE: dict[str, Any]

references

A list of unresolved references.

TYPE: list[Reference]

Attributes

elements_by_id instance-attribute
elements_by_id: dict[str, Any] = {}

A mapping from element ID to element instance.

references instance-attribute
references: list[Reference] = []

A list of unresolved references.

Functions

add_element
add_element(element: Any) -> None

Add a processed element.

add_reference
add_reference(reference: Reference) -> None

Add an unresolved reference.

ParseResult

ParseResult(definitions: Definitions, context: ParseContext)

Result for parsing a BPMN file.

Parser

Parser(
    moddle_extensions: Optional[list[Path]] = None,
    ns_map: Optional[dict[str, str]] = None,
)

A parser for BPMN files.

METHOD DESCRIPTION
parse_file

Parse a BPMN XML file into internal representation.

parse_string

Parse a BPMN XML string into internal representation.

Functions

parse_file
parse_file(xml_file: Path) -> ParseResult

Parse a BPMN XML file into internal representation.

PARAMETER DESCRIPTION
xml_file

The path to a BPMN XML file

TYPE: Path

RETURNS DESCRIPTION
ParseResult

Definitions object

parse_string
parse_string(xml_str: str) -> ParseResult

Parse a BPMN XML string into internal representation.

PARAMETER DESCRIPTION
xml_str

A BPMN XML string

TYPE: str

RETURNS DESCRIPTION
ParseResult

Dictionary containing parsed nodes and flows

Reference dataclass

Reference(element_id: str, property: str, reference_id: str)

A reference to an element that has not been fully processed yet.

ATTRIBUTE DESCRIPTION
element_id

The ID of the element that containing the reference.

TYPE: str

property

The property on the element that contains the reference.

TYPE: str

reference_id

The id of the reference.

TYPE: str

Attributes

element_id instance-attribute
element_id: str

The ID of the element that containing the reference.

property instance-attribute
property: str

The property on the element that contains the reference.

reference_id instance-attribute
reference_id: str

The id of the reference.

Functions