There is a way, yes. The data you are looking for is stored in the Batch
table.
You will find a ClassNumber
and a Status field. Just select a record matching your class that has the status executing. If a record exists, it is being executed.
The parameters are stored in a the Parameters
field in a container. You can unpack the container be creating an instance of your class and unpacking it, like so (quick code that will not compile but you get the point):
Batch batch;
SysOperationServiceController sysOperationServiceController;
YourDataContract yourDataContract;
select batch
where batch.ClassNumber = YourClassNumber
&& batch.Status == BatchStatus::Executing;
// todo: you might have to check the type of the object before assignment
// todo: also check if batch record has been found
sysOperationServiceController = batch.object();
if (sysOperationServiceController.unpack(batch.Parameters))
{
// todo: you might have to check the type of the object before assignment
yourDataContract = sysOperationServiceController.getDataContractObject('_theParemterNameOfyourDataContract');
// todo: here you can read the parameters from your contract
}
else
{
throw error("Unpack failed");
}