Job Scheduler is not working properly even after enabling it.

I have created a job scheduler and activity to purge record older than 30 days from a data table. The activity uses a data page with report definition as its source to get the 30 days older records. Despite configuring the Job Scheduler, it’s not executing the activity automatically. However, when I trigger the activity manually, it works fine( records older than 30 days were purged in Data table and sent email notification as expected).

How to get it executed by Job scheduler. Kindly suggest a solution.

Hello @Sna05222,

Please verify that the Access Group you have selected is having access to the Ruleset version of the activity or you can use the System Runtime Context and mention your application and version in it.

Thanks!

@GitarthaD33 Yes, the access group have access to the Ruleset version of the activity and also I have mentioned my application and version in the System Runtime Context as well.

@Sna05222 Can you check the Node classification in Admin Studio and share a screenshot?

@Sna05222

I believe the threshold value is low, and your activity may take longer than the set threshold value. Please increase the threshold value.

@GitarthaD33

When I checked the Admin studio, there are some execution, that got failed due to RuleNotFoundException: Failed to find a ‘RULE-OBJ-ACTIVITY’ with the name ‘Activity name’ that applies to ‘Class Name’. There were 1 rules with this name in the rulebase, but none matched this request.

But both the rules Job Scheduler and Activity has been created in the same ruleset and in the same class…

I could not find any mismatch in the ruleset or class.

Kindly suggest the solution.

@RameshSangili No, threshold value is not lower than the activity execution.

When activity is triggered manually, it is working fine.. as it is purging records in the DB table and sending mail notification to the receivers.

How can we rectify the RuleNotFoundException for the activity rule which should be executed by Job Scheduler.

Hello @Sna05222,

Can you please share the complete stack trace from the logs when this exception occurred? You can mask the application specifics.

Thanks!

Hi @Sna05222,

P;ease Check Siblings and Versions of the respective Rules

Could you please clear Rule Cache and Try ?

Try attempt revalidanting and saving and Please attempt this revalidation method through the reassembly.

API:

Open Admin Studio → Click Resources > APIs > System Management > Caches

Select the following POST

API: /nodes/all/caches/vtable/rule_types/{pxobjclass}/instances/{pxinsid}/reassemble

Enter the rule’s pxObjClass and pxInsID

For example - pzcaptureworkobjectsforautomaticcleanup pxObjClass: Rule-Declare-Trigger pxInsID: !PZCAPTUREWORKOBJECTSFORAUTOMATICCLEANUP (this is just an example, please use the data for the rule that you have in your environment)

Run the ‘Try it out’ button. A successful call should return 200 response code.

Please let me know even after running this, if you are still experiencing issues with Rule Cache.

Thanks,

Ashok

@Bhumireddy

Hi, I have revalidated and saved my activity rule. And also follow the steps to clear cache.. While executing it with exact class and rule name, I got response code 401.

{ “errors”: [ { “ID”: “invalid_authorization_header”, “message”: “Invalid Authentication Data.” } ] }

In this case, what can we try clearing this rule cache and make the job schedulor to execute the job?

Kindly help!!

@GitarthaD33 When trying to clear the cache of the rule activity, I got this as the response.

Hello @Sna05222,

I meant the stack trace for this exception:RuleNotFoundException: Failed to find a ‘RULE-OBJ-ACTIVITY’ with the name ‘Activity name’ that applies to ‘Class Name’. There were 1 rules with this name in the rulebase, but none matched this request

Thanks for all the discussions and ideas. I have resolved the issue. The access group which I have mentioned in the Job scheduler is with lower application version. Since I have the activity rule created in the highest application version, it got failed.

I have updated that and resolved it. Thanks for the support!!

Hi @Sna05222

Kindly check the privileges for the API, and also, in the meantime,

Check the Access Group, Ruleset Version, Application Stack, and Ruleset Stack Version for this Job Scheduler and Activity.

I hope this willl help you

Thanks,

Ashok