Hi Folks,
When the request is received from WebAPI, I need to send the response back that I have received the request and run a batch job.
So for that I need to initiate a Sysopertaion controller class to initiate the batch job which will run a batch job and simultaneously will send the response as "The request is received" and afterwards the business logic can be run in batch.
So How can I achieved this requirement in service class? And how it will run in base after wards?
Custom controller class
class abcBatchController extends SysOperationServiceController
{
public static void main(Args _args)
{
abcBatchController controller = new abcBatchController();
controller.parmLoadFromSysLastValue(false);
controller.startOperation();
}
}
Custom Service class
class abcService
{
public abcResponseContract create(abcRequestContract _RequestContract)
{
abcResponseContract responseContract = new abcResponseContract();
abcRequestContract abcReqContract = _RequestContract;
str message;
abcIntegrationHelper IntegrationHelper = new abcIntegrationHelper();
guid sessionId;
abcIntegrationStatus status;
abcBatchController requestController = new abcBatchController();
sessionId = newGuid();
status = abcIntegrationStatus::NotProcessed;
try
{
message = "";
responseContract = abcIntegrationHelper.generateResponse(abcIntegrationStatus::Success, sessionId, message);
status = abcIntegrationStatus::Success;
}
catch (Exception::Deadlock)
{
retry;
}
return responseContract;
}
}
Thanks in Advance!!