Notifications
Announcements
No record found.
So i want to create a batch job task in the UI and assign a class for it to run.
What should my class contain to make the batch job task run? should i create a controller and service class and assign the controller class to it? because i did this but i couldn't find my controller class in the classes dropdown
Hi,
You can just setup the batch job by running the action menu item that you would have created for the class and going to the "Run in the background" section
Here you set batch processing to "Yes" and set the recurrence.
This will setup the batch job.
Hi Gunjan,
The requirement is to put it there in batch job tasks.. can you help?
Not sure why you want to add batch tasks this way. The above mentioned method will create a new job and will add to the tasks as well.
In any case if you want the class to appear in the batch task drop down, add this attribute -
[SysOperationJournaledParameters(true)]
You can check class "WHSReleaseToWarehouseController" as an example.
I tried adding the parameter but it's still not appearing.
[SysOperationJournaledParameters(true)] class TestController extends SysOperationServiceController { /// /// What method to call from the service class /// protected void new() { super(classStr(TestService),methodstr(TestService,export),SysOperationExecutionMode::Synchronous); } /// /// /// public static TestController construct() { TestController controller = new TestController(); controller.parmShowDialog(false); controller.parmShowProgressForm(false); return controller; } public static void main(Args _args) { TestController controller = TestController::construct(); controller.startOperation(); } protected ClassDescription defaultCaption() { return "Export"; } }
class TestService extends SysOperationServiceBase { public void export() { //logic } }
Did you try doing a full build of the model? If not, please do that and try again.
Thanks it started appearing after the full build. However what should the status of the task be? Right now it's withhold and the batch didn't start even though i scheduled it for now. Should i change it to waiting or how can i make it start?
You have to change the job status to Waiting and set a recurrence for the job. That should start it.
Thanks alot for your help.
May i ask another thing, in my service class, i'm exporting an entity (with incremental push) and sending the file generated to a certain destination. Now when there is no content in the generated file, the destination receives a file with no content, how can i check the content if it's empty or not before sending to destination?
DMFEntityExporter exporter = new DMFEntityExporter(); fileId = exporter.exportToFile(entityName, definitionGroupName, '', //Optional: ExecutionID "XML-Element", //Optional::SourceName #FieldGroupName_AllFields, //Optional field selection query.pack(), //Optional: Filtered Query curExt() //Optional: DataAReaId );
I am not sure since I haven't tried doing this before. I will check if this can be done.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 664 Most Valuable Professional
André Arnaud de Cal... 522 Super User 2025 Season 2
Sohaib Cheema 303 User Group Leader