Submitted Jobs
  • 04 May 2023
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Submitted Jobs

  • Dark
    Light

Article summary

Submitted Jobs

Comflow supports the submit of jobs, so the processing is done in the background, so the user can continue to work in the application. Technically the job is sent to a queue manager, which releases them in the background and monitor them until they are completed. You can control how many parallell jobs that can be processed (default 5) and also the priority of the processing thread.

All submitted jobs can be monitored via My Submitted Jobs or for an administrator via All Submitted Jobs.

Settings

Job queues

Default Scheduler/job queue is "_Batch" which is an in memory manager. All jobs are submitted to this queue, if not stated otherwise in the job.

This can be configured to a persistent queue via the Quartz database as a "scheduler", normally "_PERSIST_TX". 

The settings are done in the sitedef via the Scheduler settings as below;

<Schedulers>
            <Scheduler name="_PERSIST_TX" enabled="true">
                <Properties>
                    <Property name="threadPool.threadCount" value="8"/>
                    <Property name="jobStore.dataSource" value="QUARTZ"/>
                    <Property name="jobStore.driverDelegateClass" value="org.quartz.impl.jdbcjobstore.MSSQLDelegate"/>
                </Properties>
            </Scheduler>
            <Scheduler name="_Batch" enabled="yes">
				<Properties>
					<Property name="threadPool.threadCount" value="3" />
					<Property name=" org.quartz.threadPool.threadPriority " value="5"/>
				</Properties>
			</Scheduler>
        </Schedulers>

Other job queues can be defined as other schedulers, but then the rules that are submitted needs to be changed to pinpoint these queues via it's name.

Number of Jobs

Default the system supports five submitted jobs at the time. You can override this in the sitedef for persistent queues via the setting 

"org.quartz.threadPool.threadCount". See example above.

Coding

To submit a java rule (extends AbstractRule or AbstractRuleExecute) you only create new submitter via JavaRuleSubmitter. See example below:

// Submit job
			JavaRuleSubmitter submitter = new JavaRuleSubmitter(ItemWarehouseManageImportGetDataAndUpdateM3Submit.class.getName(), "postDMProcIn", localizationService.getConstant(MOVEX, "jobname.item.warehouse.import.update.M3"), sessionWorkspace.getUserData().getLoginName(), localizationService.getLocaleId(), sessionWorkspace.getSessionValues(), mapData);
			try {
				submitter.submit();
			} catch (SchedulerException e) {
				handleException(e);
				return false;
			}

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.