Author Message
Andrew.Prokop
Joined: Oct 28, 2014
Messages: 179
Offline
Would you folks be willing to show me the skeleton code and json of how I would add a drop-down list to a dynamic task? I want something that allows the user to select one of about five different values. I understand that those values need to come from the dynamic task, but I am not sure of the exact format of the requests.

Thanks!
PrakashN
Joined: Jun 30, 2015
Messages: 105
Offline
Andrew,

In the tasks.json, in the "properties" array of the task, you will have to add something like this for a drop down property:

{
"name": "EventFamily",
"displayPropName": "Event family",
"type": "string",
"controlType": "combo",
"modelName": "setEventFamily",
"filler": "getInstance.eventFamily",
"fillerModel": "com.avaya.workflow.events.EventCatalogEntries",
"fillerLevel": "0"
}

This is an entry for an existing task (Receive Task) that has drop down boxes. The control type is 'combo'. The items of importance here is the "filler" and "fillerModel" tags. The "fillerModel" tag states the name of the class that has a function with the name defined in the "filler" tag. In the example above, there is a class "EventCatalogEntries" which will be a singleton (hence the 'getInstance'). This has a function defined as "eventFamily" which will return a list<String>. Here is that function for your reference:

public List<String> eventFamily() {
List<String> eventsFamily = new ArrayList<String>();

//for (final EventId eventId : eventList) {
// eventsFamily.add(eventId.getFamily());
//}

return eventsFamily;
}

As you can see above, this function returns a list of strings "eventsFamily". Instead of the three commented lines inside the function, you write your logic to put your elements into the target list of Strings and return that list. It will show up magically in your task's drop down.

All this is documented in the Dynamic Task Development Guide. If you need further help, feel free to reach out to me and I will schedule a call with you to get you moving.

Prakash Natarajan System Architecture Consulting Engineer Engagement Designer Avaya
Andrew.Prokop
Joined: Oct 28, 2014
Messages: 179
Offline
Fantastic. I have it all up and running. That's for the guidance.
PrakashN
Joined: Jun 30, 2015
Messages: 105
Offline
You Rock Andrew! :-)

I was kind of expecting to have a meeting with you to explain this!!

Prakash Natarajan System Architecture Consulting Engineer Engagement Designer Avaya
Andrew.Prokop
Joined: Oct 28, 2014
Messages: 179
Offline
Ha! Although it may seem like I overload you guys with questions, I try not to bug you too much. I am a rusty java programmer, but it's coming back to me quickly enough. The only problem is that this is not my full time job. Finding enough time is always a problem. :-(

Speaking of questions, is there a way that I can change the selected drop down value via System Manager Attributes and Snap-In Properties? Right now, the only way I can make changes is by creating a new version of the Snap-In. I expect I'm stuck with that since Properties and Attributes are string based.
Go to:   
Mobile view