joostvangils / BPMN_RPA

Robotic Process Automation in Windows and Linux by using Diagrams.net BPMN diagrams.
GNU General Public License v3.0
40 stars 8 forks source link

Json error while trying to execute .flw file #6

Closed catchlui closed 1 year ago

catchlui commented 1 year ago

I am executing the below piece of code.

from BPMN_RPA.WorkflowEngine import WorkflowEngine engine = WorkflowEngine(input_parameter=None,pythonpath="E:\Anaconda3_new\python.exe",installation_directory="E:\businessrules\Signature Automation\Config") doc = engine.open("E:\businessrules\Signature Automation\Config\rial_2.flw") steps = engine.get_flow(doc) nextstep = steps[0] while nextstep is not None: q = input("Execute next step? (y/n)") if q.lower()!="y": break print("\n") result = engine.run_flow(nextstep,True ) nextstep = engine.get_next_step(nextstep, steps, result) print(f"Output of this step: {result}")

when i am trying to execute using python bpmn.py i am getting below error

doc = engine.open("E:\businessrules\Signature Automation\Config\rial_2.flw") File "E:\Anaconda3_new\envs\mlops\lib\site-packages\BPMN_RPA\WorkflowEngine.py", line 203, in open dict_list = json.loads(decoded) File "E:\Anaconda3_new\envs\mlops\lib\json__init__.py", line 357, in loads return _default_decoder.decode(s) File "E:\Anaconda3_new\envs\mlops\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "E:\Anaconda3_new\envs\mlops\lib\json\decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

joostvangils commented 1 year ago

I presume that you've updated the BPMN-RPA package to the 7.0.0 version. Have you created your flow with BPMN-RPA Studio? If you've created it with DrawIO than your flow should have the extension .xml and not .flw. It is advised to use BMPMN-RPA Studio for creating and testing/debugging your flows (version 25.0.77).

catchlui commented 1 year ago

Hi , The BPMN pacakge is version 7.0.0 . But the the flow i have downloaded is of version 21.8.11. Where to get the 25.0.77 version. Could you please provide the link to download.

joostvangils commented 1 year ago

You can download the 25.0.77 version from https://www.1ic.nl/download. Could you upload your flw-file, so I can examine what goes wrong because I cannot reproduce your error.

catchlui commented 1 year ago

trial_2.zip Please find the flw file.

catchlui commented 1 year ago

Hi, Also the flw file i have generated with 25.0.77 version.

catchlui commented 1 year ago

You can download the 25.0.77 version from https://www.1ic.nl/download. Could you upload your flw-file, so I can examine what goes wrong because I cannot reproduce your error.

any luck with the file ?

joostvangils commented 1 year ago

Hello,

Just leave out the 'input_parameter=None' in the script and your trial_2.flw file works fine. See output:

Execute next step? (y/n) 14:47:13: Step 0 - 22-12-2022 Starting flow 'trial_2'... 14:47:13: Step 1 - Executing step 'start'... 14:47:13: Step 1 - Start executed. Output of this step: None Execute next step? (y/n) 14:47:16: Step 2 - Executing step 'MessageBox'... 14:47:22: Step 2 - Show executed. Output of this step: ok Execute next step? (y/n) 14:47:24: Step 3 - Executing step 'end'... 14:47:24: Step 3 - End executed. Output of this step: None Process finished with exit code 0

I suggest you check your configuration and please pay extra attention to the registry-settings on windows: image

joostvangils commented 1 year ago

An update to prevent this is available in BPMN-RPA package 7.0.1.