User info triggered from wf condition

Description
hseifert
Posts: 21
Joined: Wed Apr 17, 2013 12:10 pm
Location: Böblingen, Baden-Württemberg, Germany
Contact:

User info triggered from wf condition

Postby hseifert » Mon Nov 18, 2013 12:03 pm

Hello,

currently I'm writing some Workflow Conditions using the JavaScript-Extension. I want to give our users a helpful hint what they should do if a condition script returns false. Is there any possibility to do that? Like alert(); or anything else?

Kind regards,
Hagen Seifert
Kind regards.

Hagen

SteffPoint
Posts: 79
Joined: Wed Mar 07, 2018 1:06 pm
Location: Germany

Re: User info triggered from wf condition

Postby SteffPoint » Mon Nov 04, 2019 1:21 pm

Hello,

I know it has been a while since this question was asked, but I am also interested what "workarounds" other Polarion-users utilize.

As far as I know, the JavaScript method "alert()" doesn't work, as the workflow-script isn't executed in a webbrowser (delivering the "window"-instance, which alert() takes use of), but on the server.

Current workaround we use is the returnvalue-method:

Code: Select all

var returnvalue = "";
if(x>1){
   returnvalue = "\n x is higher than 1";
}
returnvalue;


Kind Regards,
Steffen

PatrickClaus
Posts: 20
Joined: Thu Jan 18, 2018 11:02 am
Location: Frauenauracher Str. 85, 91056 Erlangen

Re: User info triggered from wf condition

Postby PatrickClaus » Tue Nov 12, 2019 2:13 pm

As Steffen mentioned, in workflow conditions this seems to be the preferred way.
Calling alert() is not possible, but showing a tooltip / hover explanation via string is possible.

Example:

Code: Select all

var return = "Status Transition blocked: Workitem field must be so_and_so!";

var field = workflowContext.workItem.getCustomField("some_field");
if (field .getId() == "desired_value")) {
   ret = true;      
}

return;


This way, the condition will return "true" and pass if the if-condition is met.
Otherwise, it will return the first defined String as message for the User, on Hover over the blocked status transition.
Best Regards,
Patrick Claus

External service provider at Valeo Siemens eAutomotive GmbH
Frauenauracher Str. 85
91056 Erlangen, Germany
Mail Address


Return to “Polarion Application Lifecycle Management (ALM)”

Who is online

Users browsing this forum: Bing [Bot], BrianPrick, harveyel4 and 13 guests