Question
Red Alpha, LLC
US
Last activity: 15 Oct 2021 12:31 EDT
Create case from job scheduler
I have an activity that has been written that will create a new case when it is run. I have found that if I run the activity manually (through Actions->Run button/menu) the case is created properly as expected. However, I would like to call the activity from a Job Scheduler rule. When I try to run the activity from the job scheduler, the case is not created and no errors are present in the log. Any ideas? Are there internal properties perhaps that get set/referenced when running via Dev Studio that are not set when running via a timed Job Scheduler?
Thanks in advance!
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 15 Oct 2021 12:31 EDT
Maantic
IN
Are you passing the same CustActMergePage as workPage param?
increase the frequency of you scheduler, may be 5mins and trace it once from admin studio.
Maantic
IN
what is the context of the scheduler? System Runtime/Specific access group?
Activity that you are using, does it have require authentication checkbox checked?
Red Alpha, LLC
US
@Avik Mitra Thanks for the reply! The context is set as my application SysAdmin access group. I have also tried on the activity to uncheck the require authentication checkbox just now, with the same results. It previously was checked and required privelege to the work class. So I have tried both with/without authentication on the activity. I will try adjusting the system runtime context to see if that produces different results. Thanks for the thoughts! If you have any other ideas or need screenshots, please let me know.
Red Alpha, LLC
US
@AvikMitra I should also mention that the activity appears to run with no errors, (calls the svcAddWorkObject) but the case does not appear to be saved. When run manually, it is saved. So it feels like maybe something missing in the way that is called?
Maantic
IN
Have you checked logs of the node where your job scheduler is running?
svcAddWorkObject takes care of work object commit/rollback. Can you please share a screenshot of the scheduler activity if it is ok?
Red Alpha, LLC
US
@AvikMitra Thank you again. I have checked the logs extensively. In both scenarios (when run by doing Actions->Run on JBTestActivity and when run via the Job Scheduler) the log entries look exactly the same. The Log-Message steps in my activities display values of properties along the way to ensure things are getting passed along properly. No errors or warnings are displayed in the logs. But when run manually I can see the instance of the work object saved via app explorer in dev studio. When run via job scheduler, the instance of the work object is not saved/does not appear in app explorer. The pyID number is incrementing even when they do not get saved, so I believe some part of it is working and then failing but not being logged. Screenshots follow:
Accepted Solution
Updated: 15 Oct 2021 12:31 EDT
Maantic
IN
Are you passing the same CustActMergePage as workPage param?
increase the frequency of you scheduler, may be 5mins and trace it once from admin studio.
Red Alpha, LLC
US
@Avik Mitra Thank you! I believe this issue is now resolved! I was able to see in the tracer from admin studio that the work page had messages on it (that did not show in the log files). I had forgotten that we could trace a job from admin studio (no trace option on job scheduler rules in dev studio). The message on the work page was that there was no valid .pyOwnerUserID. So I set that property in the activity and the case is now being created. I can work separately to ensure the values are appropriate, but now at least the case is being created.
Once again, thank you for your assistance and persistence in helping!
-
Avik Mitra