Skip to main content
1-Visitor
May 16, 2017
Solved

How do you batch create things?

  • May 16, 2017
  • 2 replies
  • 3780 views

Hello, everyone!

 

    I want to create 100,000 things in Thingworx,one by one create is too slow,Did you have quick way to create itimport or   code to create?

    I THANK very much!

Best answer by ankigupta

In addition to Sushant details; I recommend you to do it in a try-catch block to avoid any issues.

Please refer to following link which shares details on Creating a Thing in Service Script

I hope it helps.

2 replies

5-Regular Member
May 16, 2017

Hi Ju Bin, you can create things programmatically and for that you can use the EntityService from System > Resources

So for creating n number of Things you could call that CreateThing services in a loop.

Hope this helps.

ankigupta5-Regular MemberAnswer
5-Regular Member
May 16, 2017

In addition to Sushant details; I recommend you to do it in a try-catch block to avoid any issues.

Please refer to following link which shares details on Creating a Thing in Service Script

I hope it helps.

lliangjb1-VisitorAuthor
1-Visitor
May 16, 2017

Thank you very much. I'm going to learn this code

1-Visitor
May 16, 2017

Another recommendation would be to do it in blocks ( 100 by 100 or alike ), why? Creating long lasting transactions it's a bad choice in TW. To do this, you will have to create a timer which triggers the Creation Services, and on each trigger consume like a hundred.

5-Regular Member
May 16, 2017

Thanks Carles, that's quite an important note.