Ok, so i did some more testing.
My tests shows that directory.getCurrentDirrectory somehow return the directory of where the project.json is located and NOT where the file is located.
My guess is that when i open a WF file. UiPath acually looks for the project.json file, and opens the WF in the project path instead of the actual path of the WF file.
This is really problematic for me as i offend rearrange file structure to keep sane
When calling another workflow inside a project, it automatically use a relative path, and then if i change the folder structure, it creates problems.
Imagine a file structure:
All files are a chain (so main calls WF1 that calls WF2 that calls WF3 that calls … that calls WF99)
Now i want to clean up, and move all WF files except Main to a subfolder.
Ofcause I have to change the first call from Main to WF1. That makes sense.
BUT i ALSO have to change ALL calls between the WF’s, witch is gonna take FOREVER to do…
What is the reason for this behaviour in UiPath?
Is there a way to get WINDOWS path to the current WF file, instead of UiPath’s relative project path?