It's all about the answers!

Ask a question

HTTP Filtered Value Set and Dependent Enumerations


Gary Mullen-Schultz (28725536) | asked Mar 13 '13, 5:15 p.m.
edited Mar 14 '13, 11:53 a.m. by Ralph Schoon (63.5k33646)
I would like to use the results of an HTTP Filtered Value Set as the source enumeration for a dependent enumeration.  Is this possible?  I can't figure out how to configure it (using 4.0.2 M2).

Thanks, Gary

2 answers



permanent link
Ralph Schoon (63.5k33646) | answered Mar 14 '13, 2:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Gary,

as far as I can tell from helping to write the Process Enactment Workshop, dependent enumerations require two enumeration attributes. The HTTP Filtered Value Provider typically returns values like strings and the like. Therefore it is not possible to hook it up in a dependent enumeration, as far as I know.

Comments
Gary Mullen-Schultz commented Mar 14 '13, 11:38 a.m.

Ralph:

That's what I thought, thanks.

Seems like it would be nice to be able to create an enumeration from the results of an HTTP Filtered Value Provider (or a Script Based Value Set) to be used elsewhere. 

Your thoughts?

Gary


Ralph Schoon commented Mar 14 '13, 11:52 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Gary,

I think it would be a nice idea to have a way to limit the selectable/displayed values of any attribute based on any combination of attributes. One thought I would have in your case: is it possible to use a value set for an enumeration value and feed that using a JavaScript based value provider? You can do that with Java Script in general, but I have not tried out if you can use that with an enumeration. See https://jazz.net/library/article/1093 Lab 5 for some ideas.


Sudhakar Frederick commented Mar 14 '13, 8:38 p.m. | edited Mar 14 '13, 8:39 p.m.
JAZZ DEVELOPER

Ralph Schoon commented Mar 15 '13, 2:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Nice one Freddy, I understood the question the other way around and provided a solution for that in another answer.



permanent link
Ralph Schoon (63.5k33646) | answered Mar 15 '13, 2:14 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Mar 15 '13, 3:37 a.m.
This won't fit into a comment. Based on Freddies nice blog. If you want it the other way round, you can actually feed the value set for an enumeration using the HTTP Filtered Value Set providing data for another attribute too.

You feed the value set for the enumeration with the result of the HTTP Filtered Value Set similar to this script:
/*******************************************************************************
 * Licensed Materials - Property of IBM
 * (c) Copyright IBM Corporation 2011. All Rights Reserved.
 *
 * Note to U.S. Government Users Restricted Rights:  
 * Use, duplication or disclosure restricted by GSA ADP Schedule 
 * Contract with IBM Corp. 
 *******************************************************************************/
dojo.provide("com.example.ValueSetProvider");

(function() {
    dojo.declare("com.example.ValueSetProvider", null, {

        getValueSet: function(attributeId, workItem, configuration) {
        	
		// call your HTTP Filtered Value Set for another attribute
 		// Get the value of the attribute here and do something with the value
		var panic="true"; // This is the value of the other attribute
		var result= [];
		if(panic=="true"){
			result.push("priority.literal.l11");
		} else {
			result.push("priority.literal.l02");
			result.push("priority.literal.l07");
		}
		return result;  
        }
   });
})();

Then you configure your script in the Attribute Customization like this.

And use the value set like this:


As a result you will now have only the literals to pick in the selection.


You have to pick the literal values to return from the process configuration source and just push the values you want, based on the input.

PS: You can use Jorge's trick to call a HTTP Based Filtered Value Set in JavaScript.


Comments
Ralph Schoon commented Mar 15 '13, 2:28 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Sigh, unfortunately the Enumeration presentation would not present an option to actually use the HTTP Filtered Value Set in the enumeration value picker. So you would have to store the value you pick an another attribute and use that attribute value in the script.

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.