AutomatedProcessImprovement / Simod

CLI tool for automated discovery of BPS models from event logs
Apache License 2.0
41 stars 7 forks source link

Simod produces malformed process model #154

Closed iharsuvorau closed 8 months ago

iharsuvorau commented 1 year ago

If we run simod -c resources/config/configuration_one_shot.yml, Simod produces the following BPMN XML file:

<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" targetNamespace="http://www.omg.org/bpmn20" exporter="ProM. http://www.promtools.org/prom6" exporterVersion="6.3" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
  <process id="proc_648680157">
    <startEvent id="node_6f2561e2-360f-4d15-88b6-42d1c96e3374" name=""/>
    <endEvent id="node_ffb2dcea-9e7d-4940-ada5-ff8b12a8eb76" name=""/>
    <task id="node_189e717f-cb67-4166-bd00-0a7d3698e766" name="Assess loan risk">
      <standardLoopCharacteristics testBefore="false"/>
    </task>
    <task id="node_4aeb81ff-3591-49d3-92d9-9179a64c0bf3" name="Approve application">
      <standardLoopCharacteristics testBefore="false"/>
    </task>
    <task id="node_465346bd-e815-47ad-ab38-b6afddd387f5" name="Reject application">
      <standardLoopCharacteristics testBefore="false"/>
    </task>
    <task id="node_31e67eae-26de-4ca7-a004-ac1e89be4063" name="Appraise property">
      <standardLoopCharacteristics testBefore="false"/>
    </task>
    <task id="node_5a21c23e-33cb-447c-bb29-3b4f9aeed11d" name="Design loan offer">
      <standardLoopCharacteristics testBefore="false"/>
    </task>
    <task id="node_f7f9be93-3a89-40d9-bbb3-c1b238f4d2ea" name="Return application back to applicant">
      <standardLoopCharacteristics testBefore="false"/>
    </task>
    <task id="node_9c2c9941-b66d-4027-b1aa-ef4e6ffd34be" name="Approve loan offer">
      <standardLoopCharacteristics testBefore="false"/>
    </task>
    <task id="node_1dd25f2e-d409-4ffd-b153-c538823b4119" name="AML check">
      <standardLoopCharacteristics testBefore="false"/>
    </task>
    <task id="node_27d5c14b-c0e7-4ec8-99a9-0739eb520d03" name="Cancel application">
      <standardLoopCharacteristics testBefore="false"/>
    </task>
    <task id="node_ed7d0fa9-2edd-4e7e-a5c0-8d653db6d05b" name="Check credit history">
      <standardLoopCharacteristics testBefore="false"/>
    </task>
    <task id="node_27e75454-3883-489c-bacd-076f957f4214" name="Check application form completeness">
      <standardLoopCharacteristics testBefore="false"/>
    </task>
    <task id="node_82936b56-dd27-4f34-bd8b-7f75d7a27645" name="Applicant completes form">
      <standardLoopCharacteristics testBefore="false"/>
    </task>
    <exclusiveGateway id="node_8598c848-0739-440c-addb-5ca44f787f6d" name="" gatewayDirection="Diverging">
      <incoming>
node_b46f9c85-0567-4f07-8c0b-83070b98cab7</incoming>
      <outgoing>
node_16a0d074-8df3-450d-8a21-3cdcfa4df3d6</outgoing>
      <outgoing>
node_a08d5e9e-8717-4aca-8ce4-265b326ca1a0</outgoing>
    </exclusiveGateway>
    <exclusiveGateway id="node_f7b20d20-f385-49ff-b187-86bcc3d5028b" name="" gatewayDirection="Diverging">
      <incoming>
node_ce04f7e4-1962-4a6f-8ac5-01b25054a494</incoming>
      <outgoing>
node_a1a5da64-e677-4ac5-b874-5408e8c63586</outgoing>
      <outgoing>
node_0a02fa99-3ae0-4942-9532-de2a7b81fb96</outgoing>
    </exclusiveGateway>
    <exclusiveGateway id="node_604c7802-a34e-4d66-bb64-225491fb2074" name="" gatewayDirection="Converging">
      <incoming>
node_6bc9ae78-9812-402b-a75f-abb32039a258</incoming>
      <incoming>
node_f8eedb5d-48cd-4ae2-9500-0e7c95901c3e</incoming>
      <outgoing>
node_416a7aa7-da65-4026-83db-441d3bda4291</outgoing>
    </exclusiveGateway>
    <exclusiveGateway id="node_a8a9f0e9-4306-4724-97c9-74f15b358f53" name="" gatewayDirection="Converging">
      <incoming>
node_7e2e34ac-2655-4c35-80cb-4ee57fdbe62c</incoming>
      <incoming>
node_68bd8069-5bca-4997-95eb-ef57982306ef</incoming>
      <outgoing>
node_391e4795-c9de-46c5-afe1-d74a2d568173</outgoing>
    </exclusiveGateway>
    <exclusiveGateway id="node_7a7aa25c-ce96-443c-afb8-2cac8b1cfc03" name="" gatewayDirection="Diverging">
      <incoming>
node_76074107-24cb-4a1f-bbf0-88583a49507a</incoming>
      <outgoing>
node_44f1f6fe-0d0b-43f0-ae9d-c34d0a7a4da4</outgoing>
      <outgoing>
node_53363267-b42a-422b-98b1-3aeb5ded1836</outgoing>
    </exclusiveGateway>
    <exclusiveGateway id="node_6ac6f502-9cad-4fdd-a7e8-3cd0e2499463" name="" gatewayDirection="Converging">
      <incoming>
node_391e4795-c9de-46c5-afe1-d74a2d568173</incoming>
      <incoming>
node_592f17af-11ec-49ae-9033-feacc76d31ad</incoming>
      <outgoing>
node_22876769-ab7b-466e-adeb-89117701796a</outgoing>
    </exclusiveGateway>
    <parallelGateway id="node_f9a635ac-6d7a-49e4-a10d-9ca7f222436f" name="" gatewayDirection="Converging">
      <incoming>
node_82406d79-6947-4f3c-992b-2d2edb3d6e94</incoming>
      <incoming>
node_a866e998-4466-4189-a874-87691bfb8754</incoming>
      <incoming>
node_5e6d5752-0049-4c56-81ee-005e22705846</incoming>
      <outgoing>
node_fb82cb14-ea31-4004-9480-c6100715d1e0</outgoing>
    </parallelGateway>
    <parallelGateway id="node_395f4076-1cf7-40ca-bfd8-81d8a8adcdf6" name="" gatewayDirection="Diverging">
      <incoming>
node_16a0d074-8df3-450d-8a21-3cdcfa4df3d6</incoming>
      <outgoing>
node_c88040ed-73a8-420a-a64d-4149427815db</outgoing>
      <outgoing>
node_c447d825-3ef3-4fcd-80ca-224e8b9dbf37</outgoing>
      <outgoing>
node_184c5e34-826a-4752-8f92-25736ee5021b</outgoing>
    </parallelGateway>
    <sequenceFlow id="node_e58c4cfa-293c-42c3-8f07-8f3cfabd70d1" name="" sourceRef="node_f7f9be93-3a89-40d9-bbb3-c1b238f4d2ea" targetRef="node_82936b56-dd27-4f34-bd8b-7f75d7a27645"/>
    <sequenceFlow id="node_e94da40a-ab5c-4c1c-a6c2-cfa155b128fb" name="" sourceRef="node_5a21c23e-33cb-447c-bb29-3b4f9aeed11d" targetRef="node_9c2c9941-b66d-4027-b1aa-ef4e6ffd34be"/>
    <sequenceFlow id="node_b46f9c85-0567-4f07-8c0b-83070b98cab7" name="" sourceRef="node_27e75454-3883-489c-bacd-076f957f4214" targetRef="node_8598c848-0739-440c-addb-5ca44f787f6d"/>
    <sequenceFlow id="node_16a0d074-8df3-450d-8a21-3cdcfa4df3d6" name="" sourceRef="node_8598c848-0739-440c-addb-5ca44f787f6d" targetRef="node_395f4076-1cf7-40ca-bfd8-81d8a8adcdf6"/>
    <sequenceFlow id="node_184c5e34-826a-4752-8f92-25736ee5021b" name="" sourceRef="node_395f4076-1cf7-40ca-bfd8-81d8a8adcdf6" targetRef="node_31e67eae-26de-4ca7-a004-ac1e89be4063"/>
    <sequenceFlow id="node_c447d825-3ef3-4fcd-80ca-224e8b9dbf37" name="" sourceRef="node_395f4076-1cf7-40ca-bfd8-81d8a8adcdf6" targetRef="node_ed7d0fa9-2edd-4e7e-a5c0-8d653db6d05b"/>
    <sequenceFlow id="node_c88040ed-73a8-420a-a64d-4149427815db" name="" sourceRef="node_395f4076-1cf7-40ca-bfd8-81d8a8adcdf6" targetRef="node_1dd25f2e-d409-4ffd-b153-c538823b4119"/>
    <sequenceFlow id="node_a08d5e9e-8717-4aca-8ce4-265b326ca1a0" name="" sourceRef="node_8598c848-0739-440c-addb-5ca44f787f6d" targetRef="node_f7f9be93-3a89-40d9-bbb3-c1b238f4d2ea"/>
    <sequenceFlow id="node_76074107-24cb-4a1f-bbf0-88583a49507a" name="" sourceRef="node_189e717f-cb67-4166-bd00-0a7d3698e766" targetRef="node_7a7aa25c-ce96-443c-afb8-2cac8b1cfc03"/>
    <sequenceFlow id="node_44f1f6fe-0d0b-43f0-ae9d-c34d0a7a4da4" name="" sourceRef="node_7a7aa25c-ce96-443c-afb8-2cac8b1cfc03" targetRef="node_5a21c23e-33cb-447c-bb29-3b4f9aeed11d"/>
    <sequenceFlow id="node_53363267-b42a-422b-98b1-3aeb5ded1836" name="" sourceRef="node_7a7aa25c-ce96-443c-afb8-2cac8b1cfc03" targetRef="Event_86255fd3-f4e5-4680-9829-1e0a9fefee13"/>
    <sequenceFlow id="node_ce04f7e4-1962-4a6f-8ac5-01b25054a494" name="" sourceRef="node_9c2c9941-b66d-4027-b1aa-ef4e6ffd34be" targetRef="node_f7b20d20-f385-49ff-b187-86bcc3d5028b"/>
    <sequenceFlow id="node_a1a5da64-e677-4ac5-b874-5408e8c63586" name="" sourceRef="node_f7b20d20-f385-49ff-b187-86bcc3d5028b" targetRef="Event_50fdd5f4-23a4-418b-94aa-32884360b42d"/>
    <sequenceFlow id="node_0a02fa99-3ae0-4942-9532-de2a7b81fb96" name="" sourceRef="node_f7b20d20-f385-49ff-b187-86bcc3d5028b" targetRef="Event_28568525-cd88-4e90-959e-ab226cb94458"/>
    <sequenceFlow id="node_7e2e34ac-2655-4c35-80cb-4ee57fdbe62c" name="" sourceRef="node_27d5c14b-c0e7-4ec8-99a9-0739eb520d03" targetRef="node_a8a9f0e9-4306-4724-97c9-74f15b358f53"/>
    <sequenceFlow id="node_68bd8069-5bca-4997-95eb-ef57982306ef" name="" sourceRef="node_4aeb81ff-3591-49d3-92d9-9179a64c0bf3" targetRef="node_a8a9f0e9-4306-4724-97c9-74f15b358f53"/>
    <sequenceFlow id="node_416a7aa7-da65-4026-83db-441d3bda4291" name="" sourceRef="node_604c7802-a34e-4d66-bb64-225491fb2074" targetRef="node_27e75454-3883-489c-bacd-076f957f4214"/>
    <sequenceFlow id="node_6bc9ae78-9812-402b-a75f-abb32039a258" name="" sourceRef="node_82936b56-dd27-4f34-bd8b-7f75d7a27645" targetRef="node_604c7802-a34e-4d66-bb64-225491fb2074"/>
    <sequenceFlow id="node_f8eedb5d-48cd-4ae2-9500-0e7c95901c3e" name="" sourceRef="node_6f2561e2-360f-4d15-88b6-42d1c96e3374" targetRef="node_604c7802-a34e-4d66-bb64-225491fb2074"/>
    <sequenceFlow id="node_fb82cb14-ea31-4004-9480-c6100715d1e0" name="" sourceRef="node_f9a635ac-6d7a-49e4-a10d-9ca7f222436f" targetRef="node_189e717f-cb67-4166-bd00-0a7d3698e766"/>
    <sequenceFlow id="node_5e6d5752-0049-4c56-81ee-005e22705846" name="" sourceRef="node_ed7d0fa9-2edd-4e7e-a5c0-8d653db6d05b" targetRef="node_f9a635ac-6d7a-49e4-a10d-9ca7f222436f"/>
    <sequenceFlow id="node_a866e998-4466-4189-a874-87691bfb8754" name="" sourceRef="node_1dd25f2e-d409-4ffd-b153-c538823b4119" targetRef="node_f9a635ac-6d7a-49e4-a10d-9ca7f222436f"/>
    <sequenceFlow id="node_82406d79-6947-4f3c-992b-2d2edb3d6e94" name="" sourceRef="node_31e67eae-26de-4ca7-a004-ac1e89be4063" targetRef="node_f9a635ac-6d7a-49e4-a10d-9ca7f222436f"/>
    <sequenceFlow id="node_22876769-ab7b-466e-adeb-89117701796a" name="" sourceRef="node_6ac6f502-9cad-4fdd-a7e8-3cd0e2499463" targetRef="node_ffb2dcea-9e7d-4940-ada5-ff8b12a8eb76"/>
    <sequenceFlow id="node_592f17af-11ec-49ae-9033-feacc76d31ad" name="" sourceRef="node_465346bd-e815-47ad-ab38-b6afddd387f5" targetRef="node_6ac6f502-9cad-4fdd-a7e8-3cd0e2499463"/>
    <sequenceFlow id="node_391e4795-c9de-46c5-afe1-d74a2d568173" name="" sourceRef="node_a8a9f0e9-4306-4724-97c9-74f15b358f53" targetRef="node_6ac6f502-9cad-4fdd-a7e8-3cd0e2499463"/>
    <intermediateCatchEvent id="Event_50fdd5f4-23a4-418b-94aa-32884360b42d">
      <incoming>node_a1a5da64-e677-4ac5-b874-5408e8c63586</incoming>
      <outgoing>Flow_d6d9ec73-23a9-476c-9329-c5c373906740</outgoing>
      <timerEventDefinition id="TimerEventDefinition_ff6b2ef7-959e-4cb3-8d91-46b6f23f8092"/>
    </intermediateCatchEvent>
    <sequenceFlow id="Flow_d6d9ec73-23a9-476c-9329-c5c373906740" sourceRef="Event_50fdd5f4-23a4-418b-94aa-32884360b42d" targetRef="node_4aeb81ff-3591-49d3-92d9-9179a64c0bf3"/>
    <intermediateCatchEvent id="Event_86255fd3-f4e5-4680-9829-1e0a9fefee13">
      <incoming>node_53363267-b42a-422b-98b1-3aeb5ded1836</incoming>
      <outgoing>Flow_72e9dd0f-be7a-4eb4-8ebb-91319e89a649</outgoing>
      <timerEventDefinition id="TimerEventDefinition_ecf15579-ef54-4426-9580-dc3af185af63"/>
    </intermediateCatchEvent>
    <sequenceFlow id="Flow_72e9dd0f-be7a-4eb4-8ebb-91319e89a649" sourceRef="Event_86255fd3-f4e5-4680-9829-1e0a9fefee13" targetRef="node_465346bd-e815-47ad-ab38-b6afddd387f5"/>
    <intermediateCatchEvent id="Event_28568525-cd88-4e90-959e-ab226cb94458">
      <incoming>node_0a02fa99-3ae0-4942-9532-de2a7b81fb96</incoming>
      <outgoing>Flow_ea0d7316-65d1-46ae-bb7e-108414ec0b89</outgoing>
      <timerEventDefinition id="TimerEventDefinition_682b4a1b-8536-4f48-882e-bca22e5f8088"/>
    </intermediateCatchEvent>
    <sequenceFlow id="Flow_ea0d7316-65d1-46ae-bb7e-108414ec0b89" sourceRef="Event_28568525-cd88-4e90-959e-ab226cb94458" targetRef="node_27d5c14b-c0e7-4ec8-99a9-0739eb520d03"/>
  </process>
  <bpmndi:BPMNDiagram id="id_48333991">
    <bpmndi:BPMNPlane bpmnElement="proc_648680157"/>
  </bpmndi:BPMNDiagram>
</definitions>

Thus, https://prosimos.cloud.ut.ee can't preview the uploaded BPMN model if it comes from Simod.

iharsuvorau commented 1 year ago

@david-chapela I'm checking now the updated SplitMiner tool. Perhaps, this is the source of error.

david-chapela commented 1 year ago

@iharsuvorau I think there are two things happening there:

  1. Lack of visualization (any tool, Prosimos is just an example): this is because the BPMN file outputted by SplitMiner lacks the graphic information (e.g., the bpmndi:BPMNDiagram). I don't know if the other version of SplitMiner was creating this information with the coordinates of each node and arc, but without it, there's no visualization. I think these tools only depict what the coordinates say, so if there are no coordinates, they don't depict anything.
  2. Wrong format: I think there were a couple of different structures around there. For example, APROMORE had one in the beginning that was different from the Prosimos one. It could be that the SplitMiner we are using now outputs a structure with some lacking tags.

Let me know if you find something different in the SplitMiner implementation we are using now (specially if the previous one was creating a visualization). If not, we can check and discuss how to solve this.

iharsuvorau commented 1 year ago

@david-chapela

  1. Yes, I believe the old version produced the visualization. Probably, that was causing this issue with an external display that has to be present to use SplitMiner before my refactoring. I'm looking into this one now if I can return this visualization back. Really don't want to go back to the old SplitMiner that requires an external display.
  2. The BPMN format is modified in Simod when adding extraneous timers, https://github.com/AutomatedProcessImprovement/Simod/blob/master/src/simod/extraneous_delays/utilities.py#L40. The top-level tag gets filtered out.
david-chapela commented 1 year ago

@iharsuvorau

  1. It would be wonderful if we get the visualization back. I thought we never got one, but maybe there's some library for BPMN visualization generation around there. Also, if you find a way, do it for the last BPMN file, because when extraneous adds timers, it removes the visualization component (I didn't know how to recalculate the coordinates after adding the timer components, so I removed the visualization data).
  2. Ahhhhhh I can remove that code if it causes problems, I remember I was altering some of the BPMN structure so APROMORE could read them, maybe old versions.