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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

parseDate works in service but does not work in subscription

Willie
16-Pearl

parseDate works in service but does not work in subscription

The parseDate function works when I run it in a service for testing purposes, but it does not work when I try to use it in a subscription that calls a service that uses the parseDate function.

Please see below:

 

Working example: Converts PST time to JST time

Thingworx - 2020-02-21 - parseDate working.PNG

 

Not working: Service called by subscription

Thingworx - 2020-02-21 - Service called in subscription.PNG

 

Error: "Invalid format"

Thingworx - 2020-02-21 - parseDate invalid format error.PNG

 

For reference:

https://www.ptc.com/en/support/article/CS219448

https://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html

ACCEPTED SOLUTION

Accepted Solutions

I found the error....

 

It seems that I was using "eventData" instead of "eventData.newValue.value" as the input in the subscription....

The subscription is triggered based on DataChange.

View solution in original post

5 REPLIES 5
PaiChung
22-Sapphire I
(To:Willie)

It seems to want to 'pass on' time from epoch?

not sure why it works in one and not the other, is there any basetype differences?

Basetypes of both services:

 

Input: string

Output: TimeStamp

I found the error....

 

It seems that I was using "eventData" instead of "eventData.newValue.value" as the input in the subscription....

The subscription is triggered based on DataChange.

slangley
23-Emerald II
(To:Willie)

Hi @Willie.

 

Which version of ThingWorx are you running? We tested under 8.5.3 and received an unexpected result.  We'll probably need to open an internal case for this.

 

Regards.

 

--Sharon

I am using thingworx v8.4.5

Announcements


Top Tags