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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Parallel execution and combine results

sbt
13-Aquamarine
13-Aquamarine

Parallel execution and combine results

Hello,

I have 10 things(eg.) which has a common service called fun1() which outputs Infotable as result by making an external API call.

I would like to union the infotable results from all the 10things fun1() call finally.

Instead of looping through each thing and waiting for the output, I would like to run them in parallel as the output is independent of each other and finally once we get the result of all i have to union them to give one result.

 

What is the best approach in Thingworx. 

 

Thank You!!

 

1 ACCEPTED SOLUTION

Accepted Solutions
slangley
23-Emerald II
(To:sbt)

Hi @sbt.

 

There are a lot of unknowns regarding your use case, efficiency, performance, etc. so it's difficult to make a recommendation.  This scenario would best be handled by one of our global services consultants.  You can engage with them through the Sales team.

 

Regards.

 

--Sharon

 

 

 

View solution in original post

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

You could do it by having each of those services set some value in a property besides perhaps placing the retrieved value in another property.

Then have a property data change event into a subscription to evaluate if all services finished to then pick up and stitch the final output together.

This does mean it is happening asynch and you have to use something else then to pick up the final output.

sbt
13-Aquamarine
13-Aquamarine
(To:PaiChung)

Since the no. of things which is going to call the API is dynamic, meaning it can go to more than 20 too sometimes. And the results(Infotable) have to combined and shown on a grid on the button event from the mashup. 

Imagine like user can select 10or20 but the output is one infotable.

So here setting property would not be ideal right.??

 

 

PaiChung
22-Sapphire I
(To:sbt)

Is there no way to know how many calls will be made? Because if you know you can always retain that number for that particular call and use that to gauge if the calls have finished.

After that potentially with yet another data change and a getproperties - push on update - mashup parameter - mashup parameter changed event - retrieve final value could be possible.

sbt
13-Aquamarine
13-Aquamarine
(To:PaiChung)

Yes that's the issue we don't know how many user can request the data.

slangley
23-Emerald II
(To:sbt)

Hi @sbt.

 

There are a lot of unknowns regarding your use case, efficiency, performance, etc. so it's difficult to make a recommendation.  This scenario would best be handled by one of our global services consultants.  You can engage with them through the Sales team.

 

Regards.

 

--Sharon

 

 

 

Top Tags