Skip to main content
Jan 23, 2020 5:07 PM UTC
Solved

Scheduler in thingworx

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
rosharmaAnswer
Jan 27, 2020 7:57 AM UTC

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

Jan 24, 2020 4:39 AM UTC

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

Jan 24, 2020 11:56 AM UTC

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

Jan 26, 2020 3:07 PM UTC

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.