I am exploring the BProc and must say looks very useful. Nice piece of work.
For my process user tasks, I am reusing existing CUBA Screens mostly, but at certain Tasks I precise to slightly modify the screen button panels, but only in case the screen is executed in the context of a process.
Provisonally I do the call ‘processFormContext.getTaskData()’ which returns a TaskData if inside a process, or null othwerwhilse, indicating me exactly that, however can anyone point out the expected CUBA way for attaining this? Is there a better way to do that?
Thanks.
Regards,
Carlos.
I presume several methods will return null when there’s no process, which would
Maybe create a new screen by extending the CUBA screen in question, and add appropriate annotations to make it CUBA Process Form, such as @ProcessForm, and injecting appropriate process variables and interfaces. Remove such annotations from the screen that you extended.
Then make a copy of the screen descriptor, and rename/modify it as needed (add buttons, make some not visible etc.), and change the descriptor reference in the new screen. Update the human task in the process diagram to point to the new screen.
Or maybe just make a plain cop and modify the new screen without extending if it’s easier.
There is also nothing wrong with “null” if its ok in the context of your application, and it works, but I don’t like it because as you said yourself, maybe you get a null also in some other cases and thus it is not reliable enough.