Author Message
mguthrie
Joined: Jun 19, 2018
Messages: 38
Offline
I'm new with collections as a whole. I have a collection of strings, and I want to be able to grab a specific string from that collection and put it into a variable. The collection is dynamic, so I will not know the name of the string, but I will know what index of the string needs to be chosen. (String 1, string 2, etc.)

How do I go about doing that?
SimonBrown
Joined: Feb 21, 2014
Messages: 58
Offline
I don't think you can, happy to be corrected though.

New to OD as well and wanted to do same thing. Appears collection access is quite primitive. You have to loop over to find match.
Does not seem to have a function like IndexOf.

When you locate a collection item the variable refers to the current item. There does not seem to be a concept of true collection/array with position syntax e.g. MyCollection[1]


Unless otherwise stated. EP 7.2.0.0.1117 Dev: JVM: 1.8.0_171 OD 7.2.1.0502 tomcat-8.5.23
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Right. We tried to keep things simple here. If you need more manipulation of the data, you would need to write some Java code.
mguthrie
Joined: Jun 19, 2018
Messages: 38
Offline
Was hoping there would be an easier way, but I ended up looping through the collection based upon the DTMF option chosen. So if the caller presses 4, it will loop through the collection 4 times to reach the proper index. Since I don't expect the menu to ever go beyond 9 options, this should work fine for my scenario.
SimonBrown
Joined: Feb 21, 2014
Messages: 58
Offline
@WilsonYu

Can you provide any guides to working with Java in OD. It quite frequently gets referred too as option to resolve problems.
I have looked through the developer guide and there is no mention on how. I have looked at the main OD web site https://www.devconnectprogram.com/site/global/products_resources/avaya_aura_orchestration_designer/overview/index.gsp and cannot find any material.

Need to understand;
How to hook into Java with OD.
What classes are available and how I can use them, is there intellisense, reference documentation?
How to effect OD from Java, ideally, am I able to extend the palette of options?
I don't know Java directly, more a c# coder, but happy to pick up if can help get over all these deficiencies in OD development.
A direct example for this would be extending the functions to have an indexOf method for a collection search and a SetIndex to position collection.

Unless otherwise stated. EP 7.2.0.0.1117 Dev: JVM: 1.8.0_171 OD 7.2.1.0502 tomcat-8.5.23
WilsonYu
Joined: Nov 6, 2013
Messages: 3950
Offline
Here is some general things you can do for different cases:

1. If you need to write some custom code to process data, you would add a Servlet node from the Flow editor palette into the flow. Once you save the flow, you would get a java file created in the WEB-INF/src directory. That's where you go about writing your code specifically implementing the servletImplementation method, where your code will get executed when the execution comes to the node in the flow. In most of the customizable methods like this one, you have access to the SCESession object which holds the context for the session. Most importantly, though the SCESession object, you have access to the project variables you see in the variables editor. You would pass data between node using project variables. OD provides APIs to access variables using the SCESession class. The API reference can be found in the Eclipse help->Avaya Aura Orchestration Designer->Programmer Reference

2. Most of the VUI nodes and components such as Announce, Prompt, Grammar and Phraseset can be customized by overriding certain methods in the java file that's generated in the WEB-INF/src. The easiest way to find out what methods are available is using the Java editor tool in Eclipse. There are many Java tools and features that comes with Eclipse. Intellisense is just once of them. That's why it's such a popular IDE

We have a few sample apps in the iso package that have custom code. You just need to look into them. There are many existing posts in this forum with examples on how to do particular things. You just need to do a search on something specific .
Go to:   
Mobile view