" /> how to update user defined field in calling list after applying the selection o - Genesys CTI User Forum

Author Topic: how to update user defined field in calling list after applying the selection o  (Read 13959 times)

Offline kevinwang

  • Full Member
  • ***
  • Posts: 159
  • Karma: 0
Advertisement
I customized a tab frame in interaction-information for GAD,where  agent can attach disposition code as user data,
I defined these disposition codes in cma's business attribute, this field is also a user defined field of calling list.
My question is how to update user defined field in calling list after applying the selection of dispostion code as user data?
Is there any callling list related class or method in AIL I can use to do this?
because when agent markdone a outbound call, predefined callling list fields like call result, do not call, call time etc will be updated automatically.
there must be some easy way to do this other than using basic jsp sql way, I mean, open a db connection, statement, resultset...close db connection..

Offline kevinwang

  • Full Member
  • ***
  • Posts: 159
  • Karma: 0
Ichecked the JAVA AIL SDK, should I use OutboundRecord interface, under which there are many  field get/set method.
Has anyone ever done this?

Offline kevinwang

  • Full Member
  • ***
  • Posts: 159
  • Karma: 0
my question changed, my new question is how I can get the instance of this class OutboundRecord by interaction id?

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Hi Kevin

The code below should work but I haven't had a chance to test it.

[code]Agent agentExample = (Agent) myAilFactory.getPerson("Agent_ID");
Interaction myInteraction = myAilFactory.getInteraction(...interaction ID...);
OutboundService myOutboundService = agentExample.getOutboundService();
OutboundChain myOutboundChain = myOutboundService.getChain(myInteraction);
OutbounRecord myOutboundRecord = myOutboundChain.getActiveRecord();
[/code]

R.

Offline kevinwang

  • Full Member
  • ***
  • Posts: 159
  • Karma: 0
Thank you very much, It seems right, I will try it.

Offline kevinwang

  • Full Member
  • ***
  • Posts: 159
  • Karma: 0
I tried , but there is a java.lang.NullPointerException error for 
OutboundService myOutboundService = myAgent.getOutboundService();
any suggestion?



org.apache.jasper.JasperException: Exception in JSP: /custom/apply-codes.jsp:27

24:    /* Code for calling list update */
25:   
26:    Agent myAgent = (Agent)factory.getPerson(userName);
27:    OutboundService myOutboundService = myAgent.getOutboundService();
28:    OutboundChain myOutboundChain = myOutboundService.getChain(interaction);
29:    OutboundRecord myOutboundRecord = myOutboundChain.getActiveRecord();
30:   


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.genesyslab.uadthin.filter.CachePreventFilter.doFilter(CachePreventFilter.java:30)
com.genesyslab.uadthin.filter.UTF8Filter.doFilter(UTF8Filter.java:127)


root cause

java.lang.NullPointerException
org.apache.jsp.custom.apply_002dcodes_jsp._jspService(apply_002dcodes_jsp.java:76)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.genesyslab.uadthin.filter.CachePreventFilter.doFilter(CachePreventFilter.java:30)
com.genesyslab.uadthin.filter.UTF8Filter.doFilter(UTF8Filter.java:127)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.25 logs.


Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Hi Kevin,

I have no chance to test it so just few ideas...

Could you check that myAgent object is returned = it is not null?
Is Outbound Contact Server listed on Connection tab of GDesktop application?
Is there any error in GDesktop log?

R.

Offline kevinwang

  • Full Member
  • ***
  • Posts: 159
  • Karma: 0
I guess I missed this code: document.forms.xxxxx.elements.userName value = userName in custom.xml
but , I haven't got a chance to test it.
Thank  you very much. your suggestion is very valuable.

Offline kevinwang

  • Full Member
  • ***
  • Posts: 159
  • Karma: 0
There is an exception error on  line 29.

28:    OutboundChain myOutboundChain = myOutboundService.getChain(interaction);
29:    OutboundRecord myOutboundRecord = myOutboundChain.getActiveRecord();

it seems I got  the OutboundChain instance correctly, but why there is an NullPointerException in 29?
because getActiveRecord() doesn't need any parameter, if OutboundChain is no problem, there should not be a problem with getActiveRecord().
Am I right?





message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Exception in JSP: /custom/apply-codes.jsp:29

26:    Agent myAgent = (Agent)factory.getPerson(userName);
27:    OutboundService myOutboundService = myAgent.getOutboundService();
28:    OutboundChain myOutboundChain = myOutboundService.getChain(interaction);
29:    OutboundRecord myOutboundRecord = myOutboundChain.getActiveRecord();
30:   
31:
32:    /* Apply disposition code in interaction


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.genesyslab.uadthin.filter.CachePreventFilter.doFilter(CachePreventFilter.java:30)
com.genesyslab.uadthin.filter.UTF8Filter.doFilter(UTF8Filter.java:127)


root cause

java.lang.NullPointerException
org.apache.jsp.custom.apply_002dcodes_jsp._jspService(apply_002dcodes_jsp.java:78)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.genesyslab.uadthin.filter.CachePreventFilter.doFilter(CachePreventFilter.java:30)
com.genesyslab.uadthin.filter.UTF8Filter.doFilter(UTF8Filter.java:127)


Offline kevinwang

  • Full Member
  • ***
  • Posts: 159
  • Karma: 0
[quote author=kevinwang link=topic=5472.msg23885#msg23885 date=1271697020]
There is an exception error on  line 29.

28:    OutboundChain myOutboundChain = myOutboundService.getChain(interaction);
29:    OutboundRecord myOutboundRecord = myOutboundChain.getActiveRecord();

it seems I got  the OutboundChain instance correctly, but why there is an NullPointerException in 29?


Maybe I didn't get OutboundChain instance correctly?

the following I got from AIL SDK:

getChain(Interaction ixn)
          Returns the outbound chain associated with the given interaction, or null, if this interaction has no outbound information.

But this is really a out bound interaction, why no outboundchain returned?


Kevin

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Kevin,

Please double-check that myOutboundChain is not null. There should be no exception raised in case getActiveRecord() returns NULL as you're not using this object. Exception is thrown when you try to use NULL object.

Please check as well that variable "interaction" points to valid instance of Interaction class.

R.

Offline kevinwang

  • Full Member
  • ***
  • Posts: 159
  • Karma: 0
Hi ,rene,

thank you very much for your reply.

I can't get an OutboundChain instance by myOutboundService.getChain(interaction);
So I checked interaction, I found its interaction.Type is Phone_call.
Because getChain() method returns the outboundchain assoiciated with the given interaction, or null, if this interaction has no outbound information. So I doubt if the Interaction.TYPE is not correct?
If the interaction is a outbound call,  What type of interaction should be?
PHONE_CALL_OUTBOUND?

Kevin

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Hi Kevin,

Yes, call type should be outbound. If it is inbound then the getChain() method returns null as there is no outbound service available.

How do you generate the calls?

R.

Offline kevinwang

  • Full Member
  • ***
  • Posts: 159
  • Karma: 0
there is a campaign running, dialing mode is perdictive with seizing, only one record in calling list (just for testing),
I mean I am very sure call was generated by ocs.


kevin

Offline kevinwang

  • Full Member
  • ***
  • Posts: 159
  • Karma: 0
However, in GAD, when there is call coming, the arrow indicates it's a inbound call, and phone number is a port number for cpd.(this is a testing environment, no other call possible).