HTTP Filtered Value Set and Dependent Enumerations
2 answers
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
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
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.
Would http://sudhakarf.wordpress.com/2013/03/15/http-filtered-value-set-providers-and-dependent-enumerations/ be an alternative approach?
Nice one Freddy, I understood the question the other way around and provided a solution for that in another answer.
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.