sartography / cr-connect

0 stars 0 forks source link

Better Error Message of Modeler Executable option is unchecked #601

Closed calexh-sar closed 2 years ago

calexh-sar commented 2 years ago

On the Modeler General tab, the is the Executable option image.png

When checked the last part of the bpmn:definitions XML indicates `isExecutable="true"

<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_5d31ba5" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.3.0">
  <bpmn:process id="Process_Non-Funded_Agreement" name="Non-Funded Agreement" isExecutable="true">

If that checkbox is inadvertently unchecked, the it appears that the validator throws this error:

image.png

Once the checkbox is checked again, validation passes. But from this point it seems to pass validation regardless of whether the checkbox is checked or not.

@danfunk did some digging and posted in Slack:

ok, very interesting, right now we specifically look for the bolded bit here: <bpmn:process id="Process_IDE" name="IDE" isExecutable="true">
5:01
And for whatever reason the way you build that file, created a bpmn process that does not even have that tag in it.

So it seems if it is unchecked, it doesn't add that tag, but once it is checked, the tag is there and toggles between true and false.

Dan also indicated the code related to this is 'if child.tag.endswith('process') and child.attrib.get('isExecutable', False):' and that it is 'weird the code I'm looking at would have me thinking the opposite'.

Work on this ticket is to get a better error message if the tag is not in the XML.

cullerton commented 2 years ago

@calexh-sar FYI, I'm seeing this error when updating a workflow, not when validating. Specifically, the error occurs when we try to set the primary process. Validation seems to work for a workflow, if I remove the isExecutable tag.

Is this what you were seeing, or did it actually happen during validation?

calexh-sar commented 2 years ago

@cullerton I was not aware there was a difference between "updating a workflow" and "validating the workflow", so it very well could have happened during the updating process only.

cullerton commented 2 years ago

@calexh-sar For one you click the save button, and for the other you click the shield button.

calexh-sar commented 2 years ago

@cullerton understood, I just assumed, incorrectly I now know, that the validation was getting called in both cases.