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

Anyone used the scheduler in 8.5 version.

SOLVED
sagarmemane92
Garnet

Anyone used the scheduler in 8.5 version.

I am trying to used the scheduler but unfortunately my subscription not called for scheduler .Didn't get the exact solution while digging it.

Need help !!

 

 

Thanks in advance 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Anyone used the scheduler in 8.5 version.

Well, it depends on what you put in the timestamp field when you save data in that datatable.

 

One way to troubleshoot it is by opening this datatable in Composer and go to its Mashup -- this will give you a preview of what's inside. 

 

Also try to wrap filters into an array, like this:

"filters": [{

 

Finally, in 90% of cases you should use Streams or ValueStreams instead of DataTables -- they are indexed by timestamp and thus optimized for such kind of queries. Your data table will start slowing your system down after it receives few thousands of records, which usually happens very soon.

 

/ Constantine

View solution in original post

9 REPLIES 9

Re: Anyone used the scheduler in 8.5 version.

Hi @sagarmemane92.

 

I'm not clear on the issue.  Can you please provide more details.  Are you getting an error?  Screenshots may be helpful.

 

Regards.

 

--Sharon

Re: Anyone used the scheduler in 8.5 version.

Hey Slangley,

 

I want to send the data automatically.I am using the data table .In service i am fetching the data and in subscription i am sending trying to send the data in html format through mail.But unfortunately my subscription not calling .I don't exactly error.(Script log- Error in: EMS_Scheduler_Sagar.Weekly_PF_Report javascript service)

Here I am attaching the service and subscription file 

 

 

Thanks in advance 

 

Sagar

 

Re: Anyone used the scheduler in 8.5 version.

Hello Sagar,

 

Here, in the very first line you should use "logger" instead of "Logger":

Logger.warn("Gandtay");

 

/ Constantine 

Tags (1)

Re: Anyone used the scheduler in 8.5 version.

Hey Constantine,

 

Its working . in there i need to change my HTML code little bit , So i will do that

 

Thanks For Help and quick response

 

 

 

Thanks  and regard

Sagar Memane

Re: Anyone used the scheduler in 8.5 version.

Hi Constantine,

I have written below code to take the data daily,weekly and monthly ,but it doesn't work.It shows all the data of data table.

Can you help me in this

 

var days=7; // Days you want to subtract
var currentdate = new Date();
var lastDate = new Date(currentdate.getTime() - (days * 24 * 60 * 60 * 1000));
var day =lastDate.getDate();
var month=lastDate.getMonth()+1;
var year=lastDate.getFullYear();
var myquery =
{
"filters": {
"type": "Between",
"fieldName": "timestamp",
"from": lastDate,
"to": currentdate
}
};

var result = Things["ProductionLine_Data"].QueryDataTableEntries({
maxItems: undefined /* NUMBER */,
query: myquery /* QUERY */,
values: undefined /* INFOTABLE */,
source: undefined /* STRING */,
tags: undefined /* TAGS */
});

 

 

Thanks 

Sagar

  

Re: Anyone used the scheduler in 8.5 version.

Well, it depends on what you put in the timestamp field when you save data in that datatable.

 

One way to troubleshoot it is by opening this datatable in Composer and go to its Mashup -- this will give you a preview of what's inside. 

 

Also try to wrap filters into an array, like this:

"filters": [{

 

Finally, in 90% of cases you should use Streams or ValueStreams instead of DataTables -- they are indexed by timestamp and thus optimized for such kind of queries. Your data table will start slowing your system down after it receives few thousands of records, which usually happens very soon.

 

/ Constantine

View solution in original post

Re: Anyone used the scheduler in 8.5 version.

Hey Constantine,

 

Thanks for help

 

Regards,

Sagar

Re: Anyone used the scheduler in 8.5 version.

Hello @sagarmemane92 ,

 

  1. Make sure that the Scheduler is enabled;
  2. Make sure that the Subscription is enabled;
  3. Make sure the Scheduler executes under a user with sufficient access rights. For testing try Administrator;
  4. Check your cron string (ThingWorx syntax is not 100% compatible with that of the classic cron);

/ Constantine

Re: Anyone used the scheduler in 8.5 version.

Hi Constantine,

 

 Thanks For feedback ,

 

But i already did this changes.But still my subscription is not calling.Even in subscription Logger.warn("error); is also not working

 

I am attaching mu service and subscription here.

 

Regards

Sagar

Announcements

Check out the upcoming Expert Session: Understanding ThingWorx Navigate Licensing in Community "Customer Events" section.