Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hello,
I'm looking for a workflow expression code that will launch a dialog box for the reviewer to select an item from a drop-down list when rejecting. The goal is to append the selected value to the Comments and write it into the database to later extract and report on workflow rejections.
I tried using the Java Swing Dialog, but am stuck with an error...
Here's the sample code (2nd line throwing error):
String[] codes = {"DES", "DFT", "BOM"};
String code = (String) javax.swing.JOptionPane.showInputDialog(null, "Select Rejection Code:", "You have chosen to reject this workflow:", javax.swing.JOptionPane.QUESTION_MESSAGE, null, codes, codes[1]);
if (code.trim().length() == 0) {
throw new wt.workflow.engine.FailedTransitionException(e2);
}
The error is:
wt.util.WTException: java.awt.HeadlessException
Does anyone know a way around the above error, or have an alternative method of launching a dialog box from a workflow expression?
Thank you!
@daraki wrote:
Hello,
I'm looking for a workflow expression code that will launch a dialog box for the reviewer to select an item from a drop-down list when rejecting. The goal is to append the selected value to the Comments and write it into the database to later extract and report on workflow rejections.
I tried using the Java Swing Dialog, but am stuck with an error...
.
.
.
The error is:
wt.util.WTException: java.awt.HeadlessException
Does anyone know a way around the above error, or have an alternative method of launching a dialog box from a workflow expression?
Thank you!
Workflow java code runs on the server not on the client. The "java.awt.HeadlessException" means "I have no display to connect to".
You will need to create a workflow or task variable and have the user select this on the task page. You can have code that checks to make sure the user selected something if Rejected.
Thanks for the reply. I see that makes sense... Would setting this property "java.awt.headless" to false on the server resolve this? I did come across CS36017 that outlines how to create a drop-down menu on the workflow task form, but it requires Windchill Information Modeler which we don't have. Is this the method you suggest?