This is my code to start the SHC and the callback function:
- Code: Select all
function startSHC(event) {
var obj = new Object;
obj.startdate = vStartDate;
obj.enddate = vEndDate;
obj.fs = foundset;
application.output('SHC Starting ...')
try
{
headless = plugins.headlessclient.createClient('CCS_headless',null,null,null);
if(headless != null && headless.isValid()){
application.output('SHC Started, queueing method')
headless.queueMethod(null,'sendReports',[obj], onCallbackSHC);
application.output('SHC method queued');
}else{
application.output('SHC not started.')
}
}
catch(e)
{
application.output('SHC error: '+e.message);
}
}
/**
* @param {JSEvent} event
*
* @properties={typeid:24,uuid:"A9B161F3-4634-4BDD-BE06-3EE1D28F2C47"}
*/
function onCallbackSHC(event)
{
application.output('SHC - callback')
// do some stuff
if (JSClient.CALLBACK_EVENT == event.getType())
{
// handle normal execute of remote method
}
else if (JSClient.CALLBACK_EXCEPTION_EVENT == event.getType())
{
// handle exception execute of remote method
}
headless.shutdown()
}
The solution CCS_headless is a module of my main solution. It has 2 global methods: onOpen and sendReports. Both methods start with an application.output, the one for onOpen is shown in the log, but the one for sendReports is not.
What am I missing here?