Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
1. How to fetch scheduletime of scheduler using services?
2. How to update scheduletime of scheduler using services
Solved! Go to Solution.
// getting the config table
let table=Things["sched1"].GetConfigurationTable({tableName:"Settings"});
// setting the value
table.schedule="0 4 0/1 * * ?";
Things["sched1"].SetConfigurationTable({
tableName: "Settings", configurationTable: table,
});
// returning the value
result=Things["sched1"].GetConfigurationTable({tableName:"Settings"}).schedule;
// getting the config table
let table=Things["sched1"].GetConfigurationTable({tableName:"Settings"});
// setting the value
table.schedule="0 4 0/1 * * ?";
Things["sched1"].SetConfigurationTable({
tableName: "Settings", configurationTable: table,
});
// returning the value
result=Things["sched1"].GetConfigurationTable({tableName:"Settings"}).schedule;
If I updated the value "0 44 11 ? * WED" for scheduled time through service, subscription is not triggering automatically. But If i manually update scheduler with the same scheduled time "0 44 11 ? * WED" subscription is triggering automatically. What is the issue.
Try to restart the scheduler thing after the update.
This is the code i used to set the scheduler. The CRON String is updating correctly. But subscription is not triggering.
Code:
Try to call Things["AutoGenerationReport-Scheduler"].RestartThing(); right before setting result to true.
Yes. It is working now. Thank you.
I'll get that added to the article.
How to find the services of Datashapes, Projects, ModelTags services quickly? Any documentation is there to go through all of these services in one go ?
Not sure what you mean. That is what the Services tab is for?
Plus you can consult the API documentation: http://support.ptc.com/help/thingworx_hc/javadoc/