cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
762
Views
5
Helpful
3
Replies
Enthusiast

How to create custom element in CVP

Dear Team,

I want to create the custom element in CVP call studio but unable to find any useful link or video. Please share if anyone has useful links or video.

Thank you,

Touqeer

Everyone's tags (1)
3 REPLIES 3
Highlighted
Enthusiast

Re: How to create custom element in CVP

What kind of element you want to create?

Enthusiast

Re: How to create custom element in CVP

Hi Vincent,

I want to create an element to play an array of audio files.

Beginner

Re: How to create custom element in CVP

Hi Tauqeer, 

 

You can create a custom action element by implementing ElementInterface. Here are the steps. 

 

  1. Create a new Java Class and extend it from ActionElementBase. 
  2. Implement ElementInterface to tell CVP that this is an element. 
  3. Overwride getElementName(), getDisplayFolderName() and getDescription() to give a meanigful name & description to your element. 
  4. Override doAction() method and write whatever logic you want.

Here is a simple code snippet. I have tried it is working fine. 

 

public class WebServiceAction extends ActionElementBase implements ElementInterface {

@Override
public String getElementName() {
return this.getClass().getSimpleName();
}

@Override
public String getDisplayFolderName() {
return this.getClass().getPackage().getName();
}

@Override
public String getDescription() {
return "This element does nothing :) .";
}

@Override
public void doAction(String arg0, ActionElementData arg1) throws Exception {
// write you logic here

}

}

Once you are done with your business logic. Follow these steps to see the element in the call studio. 

  1. Copy compiled (.class) file of your Java Class.
  2. Place the compiled file into your VXML project classes directory  (your-vxml-app > deploy > java > application > classes) 
  3. Make sure you place the file according to your package hierarchy. If your package name is com.ef.customelement. Create the folder hierarchy (com> ef> customelement) and then place the file. 
  4. Close your VXML application project and open it again.
  5. Double click on your app.callflow file. 
  6. You should see your element under Elements > Local Elements. 

Remember: You will not be able to see your element until you double click on your app.callflow file. Also, the element would not come up if you forget to implement a right interface or did not override the required methods.

 

Cheers! 

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards