The community will be in read-only from Monday 11:59pm (PT) to Wednesday 7:30am (PT)
The community will be in read-only from Monday 11:59pm (PT) to Wednesday 7:30am (PT)
Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Need urgent help folks....

Highlighted
Koijam Baleshwo
Regular Collector

Need urgent help folks....

Hi all,
I am working on an application that wil automatically assigned new Service call tickets in OVSD using the OVSD apis. The application is ready but it has a very poor performance, it really takes a long time to search for the new tickets from the OVSD. i need some help regarind the tunning of the performance.

Below Given is the code that fecthes all new Service calls tickets for all workgroups(currently i am using this code).


IServicecallHome scHome = session.getServicecallHome();
IServicecallWhere scWhere = scHome.createServicecallWhere();

//Get the status filter
IStatusServicecallHome stat_hm = session.getStatusServicecallHome();
IStatusServicecall status[] = stat_hm.findAllStatusServicecall();

int totalStatus = status.length;
for(int i=0;i{
String statusText = status[i].getText();

if((statusText != null) && (statusText.equalsIgnoreCase("New")))
{
scWhere.addCriteriumOnStatus(status[i]);
}
}

IServicecall[] serviceCalls = scHome.findServicecall(scWhere);

The above code takes long time to fetch the ticket as it searches for all the tickets (tickets belong to GSC09 and NON GSC09). As the application needs to search only GSC09 new tickets, the code is modified so that it fetches only new tickets for GSC09 work group. The code takes the workgroup (GSC09) as the search code and search for the service call tickets, But it fails to fetch service call tickets of GSC09 work group. The code is given below.


public ArrayList getNewTickets(String workGroupSearchCode) throws Exception
{

IServicecallHome scHome = session.getServicecallHome();



IServicecallWhere scWhere = scHome.createServicecallWhere();

IWorkgroupHome wrkGrpHome = session.getWorkgroupHome();



IWorkgroupWhere wrkGrpWhere = wrkGrpHome.createWorkgroupWhere();

wrkGrpWhere.addContainCriteriumOnSearchcode(workGroupSearchCode);

IWorkgroup[] gsc09WrkGrps = wrkGrpHome.findWorkgroup(wrkGrpWhere);



System.out.println("gsc09WrkGrps length: "+gsc09WrkGrps.length);



IAssignmentHome assignmentHome = session.getAssignmentHome();

IAssignmentWhere assignmentWhere = assignmentHome.createAssignmentWhere();



int totalWrkGrps = gsc09WrkGrps.length;

for(int i=0;i
{

IWorkgroup wrkGrp = gsc09WrkGrps[i];

//assignmentWhere.addCriteriumOnAssWorkgroup(wrkGrp);

assignmentWhere.addCriteriumOnAssignorWorkgroup(wrkGrp);

scWhere.addCriteriumOnAssignment(assignmentWhere);



//Get the status filter

IStatusServicecallHome stat_hm = session.getStatusServicecallHome();

IStatusServicecall status[] = stat_hm.findAllStatusServicecall();



int totalStatus = status.length;

for(int k=0;k
{

String statusText = status[k].getText();



if((statusText != null) && (statusText.equalsIgnoreCase("New")))

{

//scWhere.addCriteriumOnStatus(status[k]);

}

}



IServicecall[] serviceCalls = scHome.findServicecall(scWhere);



if(serviceCalls == null)

{

wrkgrps.append("\n Service calls count for wrkgrp "+wrkGrp.getName() + " is 0");

}

else

{

wrkgrps.append("\n Service calls count for wrkgrp "+wrkGrp.getName() + " is "+serviceCalls.length);

}



if(serviceCalls != null)

{

int totalCalls = serviceCalls.length;

for(int j=0;j
{

IServicecall serviceCall = serviceCalls[j];

IStatusServicecall callStatus = serviceCall.getStatus();



String toWrkGrpStr = null;



IAssignment assignment = serviceCall.getAssignment();

if (assignment != null)

{

IWorkgroup wrkGrpObj = assignment.getAssWorkgroup();

toWrkGrpStr = wrkGrpObj.getSearchcode();

}



wrkgrps.append("\n "+toWrkGrpStr);



if((toWrkGrpStr != null) && (toWrkGrpStr.indexOf(workGroupSearchCode) != -1))

{

newServiceCalls.add(serviceCall);

}

}

}

}



Anyone please have a look on this, i am really in a trouble.

Thanks in advance.
K.Balesh

2 REPLIES
Ben Snell
Member

Re: Need urgent help folks....

Hi

API performance is not good - as you are finding.

If you are purely reading data then you might consider going straight to the database?

Regards
Ben
Koijam Baleshwo
Regular Collector

Re: Need urgent help folks....

Hi Ben,

thanks for ur response.I am nor clear with what i meant to say, are you asking about directly querying the database for the new tickets? if so is it possible to don so? Please let me know the ways to acheive them. If i can get the details of these new ticket then it will work for me.Do let me know if u need any information.


Thanks in advance.
K.Balesh
//Add this to "OnDomLoad" event