It's all about the answers!

Ask a question

Is it possible to have a message/alert on the workitem based on a workflow Action?

M S Chinmayee Aradhya (11) | asked Jan 24, 8:47 a.m.
I wanted to check if there is any way in EWM to have some text/instructions displayed on the workitem when the user tries to close the work item or is changing the status of the work item to closed state.

Basically for the workflow Action which is going to mark the workitem state as closed we want to see a pop up message but that should not restrict the users to close or save the workitem it can be like an alert message which will go away with a click saying 'ok' or like a warning message which comes with validator script.

This is because we want to remind the users of some things they have to make sure before closing the work item.

And for this I tried by using the validator script (with warning message) and assigned it to the Status of the work item. But the script for validator message or icon appears only after the workitem is moved to close state and saved, before saving to closed state for the action it does not show any warning.

I also tried to use the alert("message") method but it is not showing any result on the workitem.
So is there any other way we can achieve this using Javascript or using alert() method any example is there which we can add in the attribute customizations from Eclipse. Please suggest.


2 answers

permanent link
Ralph Schoon (63.3k33646) | answered Jan 24, 9:04 a.m.

 As far as I can tell, it is basically not possible to create any pop-up messages in the work item editor. You can only prevent saving using pre-conditions/advisors. 

permanent link
Davyd Norris (2.4k217) | answered Jan 24, 5:43 p.m.
You can do this, but with some caveats:
 - a Condition is run every time something changes in the UI, so this will catch the selection of a specific action before the Save button is pressed. You can use the configuration variable passed in to examine what the Selected action was via the configuration.getWorkflowAction() function
 - because Condition customisations are run so often, you need to ensure your code runs as fast and lean as possible. Basically check your conditions for the message box in the leanest way and return as quickly as possible if they aren't met otherwise you can have performance issues
 - any type of message you pop up will only work in the Web UI, and you must write your Javascript code to examine whether or not you're in the web before you do anything like that
 - because JavaScript is single threaded, an alert() is going to block execution until the dialog is dismissed. You may or may not want this. Be very careful! It may be better to wrap it in a promise or some other pseudo-async call
 - you'll need to use window.alert() to scope the function properly, and the window object is how you would check to see if you're in a browser anyway. ELM  uses the Dojo toolkit so you may find some better dialog capability there

Your answer

Register or to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.