cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Scheduler in thingworx

VaibhavShinde
16-Pearl

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
1 ACCEPTED SOLUTION

Accepted Solutions

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 

 

View solution in original post

5 REPLIES 5

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

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

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.

Hi ,

Thank you for your response, scheduler worked. but now I am unable to send my infotable result as content in mail. how we can do it ?

 

Thank you

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 

 

Top Tags