Skip to main content
16-Pearl
January 23, 2020
Solved

Scheduler in thingworx

  • January 23, 2020
  • 5 replies
  • 4037 views
Hi,
I am looking to notify a person by using scheduler thing that is i have to notify daily, weekly, monthly basis with generating some report from datatable. I would like if i gets exact steps to follow for above requirement.

Thank you
Best answer by rosharma

infotables are basically table like structures that are understandable and recognized by platform only. structures are defined as per datashapes associated with it.

i think more appropriate way to parse that infotable result using for loop and may be use HTML <table>< Table> TR <> structures to sent as body parameter 

or may be try sending the result as attachment 

 

5 replies

16-Pearl
January 24, 2020

only if i am understanding your requirement correctly

 

i think you can create scheduler thing, set up the schedule frequency there (cron job) as per your requirement and then write subscription code to call that database thing from services to do operation and then finally you can sent email to concerned person using Mail server extension after all work is done 

database thing you need to create separately and this you can call from subscription of scheduler thing

16-Pearl
January 24, 2020

Hi rosharma,

thanks for response. but I am doing something wrong . could you check screenshots attached? subscription code is not executing (I think scheduler is not working), I am not getting any error or warning as well. could you help ?

 

Thank you

16-Pearl
January 26, 2020

Hi,

with default cron string 0 0/1 * * * ? which runs every min, the scheduler at my end is running fine. i just checked by put on loggers to services ( logger.warn("inside scheduler script") and it prints every min at my instance. though i haven't tested with email thing as currently i don't have Mail server setup here. but scheduler does work i can say.

 

i think couple of thing you can test/verify

first , see if subscription is enabled - check that on subscripton info tab under services

you can also try just by providing the loggers in subscription and see if it works.

try manually executing the EMS_MailThing sendmessage service directly from EMS_MailThing -- if this works here then it should also work from subscription as well. if it doesn't then could be issue with this sendmessage service -- may be at first up you just try sending simple text/string to "content" rather than sending whole result infotable to it.