If the screen would be dirty, what would you expect? User could still save it. It looks like, you need some sort of input from the user, otherwise the workflow result is not valid. If it is the case, I recommend not using the AllowSave feature and an extra workflow should be implemented and used as Save button. You will then get access to validation.
I think that’s exactly the case. The problem is that when the screen appears it is not dirty - only after the first user edits. So the aim is to make the screen dirty right when it gets to this step.
Yes, I generate the default data into the screen and I want to display the screen to user as “dirty”, it is new object and user is suppossed to SAVE it, otherwise everything pregenerated would be lost when the user close the tab without saving the data.
User can close the screen without any warning, so the only way how to open the screen again is that the user needs to start workflow again.
So I expect:
I show the screen to user in dirty mode, because I want him to show that the data needs to be saved
This state would also block the user to close the tab without being asked whether to save data or not
Your suggestion to use extra WF button wouldn’t work I guess:
WF button is just a normal button without indicating Changed state, it won’t become red and it would not block the user to close the tab (screen) without beeing asked whether he wants to save the current form. So the user would be able to close the screen and quit the workflow
I need to design another WF
Another solution could be NEXT button and save step after pressing next
This would hold the user inside workflow
But it is not as user friendly as SAVE button, especially when the button is red indicating there is something to save.
If there would be just one UI step, it could be managed by a standard screen with workflow data method where there are means to force dirty state. Still the first step looks like something that can be handled by selection dialog.
If I remodel the case using Load Workflow Method, would it bring me screen in edit mode into a “dirty state”? So that after the opening screen I will see the SAVE button red? That would probably solve this particular use case.
You mentioned earlier:
there are means to force dirty state.
What kind of means? Could you be please more specific? I just want to be sure if I remodel it this way, it would satisfy my use case.
I agree. But what about setting Workflow property as we use for title or notifications? That would be quite straightforward to configure this behaviour in cases when it is needed?
–
I was asking first if there is already some way how to force the screen to become dirty. As I understand now, in workflow there is no such functionality at this moment. But we might achieve the expected behaviour using workflow load data method combined with selection dialog (for 2 steps worfklow).
I’ve tried to create a sample covering this case to make sure I’m right in what I’m stating and alas I wasn’t right. Unfortunately I was basing my information on older versions of Origam, where it was sufficient to touch a virtual field in the workflow method to put dataset into dirty state. We even had to introduce a special workflow step AcceptContextStoreChanges (Forcing not dirty status in screens with workflow method).
In current version even setting a database field to a dirty state won’t yield dirty state in the UI. Dataset delivered from workflow method is handled as unchanged (not dirty). I can’t find the pull request responsible for this change, but I suspect it is the impact of change how worfklow handles context store state on input.
To sum it up - at the moment it is not possible to force dirty state and there were some changes with more profound impact than initially expected.