Skip to content

Intermediate Catch Event

Bases: Task

An API from Intermediate Catch Event from BPMN. This classes holds IntermediateCatchEventElement as elements.

Attributes:

Name Type Description
root _Element

root of BPMN loaded as XML.

Source code in bpmn_parser/_intermediate_catch_event.py
class IntermediateCatchEvent(Task):
    """An API from Intermediate Catch Event from BPMN. This classes holds `IntermediateCatchEventElement` as elements.

    Attributes:
        root (_Element): root of BPMN loaded as XML.
    """

    def __init__(self, root: _Element):
        super().__init__(root)
        self._items: Optional[list[IntermediateCatchEventElement]] = None

    @property
    def list(self):
        if self._items is not None:
            return self._items

        self._items = []
        for intermediate_catch_event in self.root.xpath(
            '//bpmn:intermediateCatchEvent', namespaces={'bpmn': self.bpmn_tag}
        ):
            time_duration = intermediate_catch_event.xpath(
                './/bpmn:timeDuration', namespaces={'bpmn': self.bpmn_tag}
            )
            self._items.append(
                IntermediateCatchEventElement(
                    id=intermediate_catch_event.get('id'),
                    name=intermediate_catch_event.get('name'),
                    time_duration=time_duration[0].text,
                    execution_listeners=self._get_execution_listeners(
                        intermediate_catch_event
                    ),
                )
            )
        return self._items

Bases: TaskElement

Parse an Intermediate Catch Event from BPMN.

Attributes:

Name Type Description
time_duration str

time duration of element in BPMN.

Source code in bpmn_parser/_intermediate_catch_event.py
@dataclass
class IntermediateCatchEventElement(TaskElement):
    """Parse an Intermediate Catch Event from BPMN.

    Attributes:
        time_duration (str): time duration of element in BPMN.
    """

    time_duration: str
type(bpmn_parser.intermediate_catch_event)
Output
bpmn_parser._intermediate_catch_event.IntermediateCatchEvent

bpmn_parser.intermediate_catch_event
Output
IntermediateCatchEvent(items=2)

List

List all intermedicate catch events elements founded in .bpmn file.

bpmn_parser.intermediate_catch_event.list

Output
[
    IntermediateCatchEventElement(
        id='Event_WaitToQueryData',
        name='Wait 1h',
        execution_listeners=[],
        time_duration='PT1H'
    ),
    IntermediateCatchEventElement(
        id='Event_WaitToPreScreening',
        name='Wait 30min',
        execution_listeners=[],
        time_duration='PT30M'
    )
]

Get

Get a specific exclusive gateway by your ID.

bpmn_parser.intermediate_catch_event.get('Event_WaitToQueryData')

Output
IntermediateCatchEventElement(
    id='Event_WaitToQueryData',
    name='Wait 1h',
    execution_listeners=[],
    time_duration='PT1H'
)