cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
76
Views
0
Helpful
0
Comments
cdnadmin
Level 11
Level 11
This document was generated from CDN thread

Created by: Richard Rhinehart on 10-08-2009 06:17:29 PM
Hello,
 
I was hoping someone could explain how to set a property of an Element from a custom action element. 
 
In my case I have an application that has a Record Element and I want to dynamically set the Path and Filename properties from a custom Action element that occurs previous to the Record element in the call flow.
 
My assumption was that I would be able to do this using the setElementData method of the ActionElementData variable.  Something like this.  Can someone please advise?  
 
ActionElementData _actionData = null;
  @Override
  public void doAction(String arg0, ActionElementData arg1) throws AudiumException {
   _actionData = arg1;
   _actionData.setElementData("Record_With_Confirm","FilePath")
 
Thank you,
Rick
 

Subject: RE: Set Element Properties from Custom Action Element
Replied by: Janine Graves on 11-08-2009 12:27:55 PM
You can only set Element data for the element that's executing the Java - that's becasue Element data is Read-Only by all other elements. The arguments for the Java class for setElementData are variableName and valueAsString - that is, setElementData(variableName,valueAsString), you do NOT specify the element name, because you can't change the value of any other element's data. You'd be better off using Session data and setting the value. setSessionData(variableName, valueAsObject). Then select that Session Variable within the Record Element's settings.
 
Janine
www.TrainingTheExperts.com

Subject: RE: Set Element Properties from Custom Action Element
Replied by: Richard Rhinehart on 11-08-2009 03:33:54 PM
Thanks Janine!
 
I have one follow up question if you don't mind.  Can I set a property in the properties pane with a session variable or would this have to be done in a custom Record element in a java class.
 
Regards,
Rick

Subject: RE: Set Element Properties from Custom Action Element
Replied by: Janine Graves on 11-08-2009 03:58:03 PM
You can certainly set a VoiceXML Property in the settings tab of an element and select a Session Variable that contains the appropriate value. But be careful. That setting value will only be in effect on the gateway until the next voice element executes. So if this property affects your recording, then you better set it under VoiceXML Properties in  the Settings tab of the Record element!!!
 
Janine

Subject: RE: Set Element Properties from Custom Action Element
Replied by: Janine Graves on 11-08-2009 04:00:57 PM
In your case, if you just want to change the filename and the path settings, you can select your Session variables to fill in those values in the Settings tab. You don't need to add any new VXML properties.  Just ensure that the Session variables contain strings (not some other Java object).
 
Janine

Subject: RE: Set Element Properties from Custom Action Element
Replied by: Richard Rhinehart on 11-08-2009 04:36:56 PM
Muchas Gracias Janine!
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links