sartography / spiff-arena

SpiffWorkflow is a software development platform for building, running, and monitoring executable diagrams
https://www.spiffworkflow.org/
GNU Lesser General Public License v2.1
51 stars 38 forks source link

Getting error when generating guest user task link with script task inside sub-process #1384

Open dinithihj opened 3 months ago

dinithihj commented 3 months ago

When generating a Guest User Task link with a Script Task using the expression "guest_task_url = get_url_for_task_with_bpmn_identifier('Enter_OTP')", it works fine when the script is placed at the same level as the User Task. However, when the Script Task is placed inside a Collapsed Sub-Process, it doesn't work and gives below error

Image

Sample Model - https://dev.app.spiff.status.im/process-models/misc:qa:generate-guest-user-task-link-using-script-task-within-subprocess

jasquat commented 3 months ago

From @burnettk in slack:

Without 100% confirmation, I’m pretty sure this looks for the human task in the same process where the script task is situated. Since we don’t give it a process identifier, I think it wouldn’t be able to find the activity otherwise. This feature is a bit of a hack, depending on spiff task guids being generated in advance, but until we think of another way to implement it, yes, I think the constraint you found is expected (and we should document it)

It would be nice if the script editor gave you an error in this case the way it stands, but like I say, I’m sort of hoping we can figure out another way of doing this

calexh-sar commented 3 months ago

Check for easy fix and if one does not exist, leave as is.

danfunk commented 1 month ago

@madhurrya , @dinithihj - please check the above comments and see if this workaround is sufficient, if so @usama9500 can document.

dinithihj commented 1 month ago

@calexh-sar Is the above-described behavior okay with you? If so, shall we go ahead and document it according to KB's comment?