Skip to main content
1-Visitor
March 4, 2021
Question

Error for deleting value stream created using CreateThing API in postman

  • March 4, 2021
  • 3 replies
  • 3579 views

Hi All,

 

I am using below details to generate value streams using postman. 

 

http://XXX.XXX.XXX.XXX:8080/Thingworx/Resources/EntityServices/Services/CreateThing

{

"name": "MyStream",

 "thingTemplateName": "ValueStream",

“description”:  “<Description of the entity>”,

“projectName” : “MyProject”

}

The value stream gets generated, I use below service-call to enable the value stream from postman.

http://XXX.XXX.XXX.XXX:8080/Thingworx/Things/MyStream/Services/EnableThing

 

Now when I check in composer the value stream exist in the system however I couldn't delete it. I got below error -

Fail - Unable to delete thing: [ValueStream_MyStream] Unable to dispose thing: [ValueStream_MyStream] null 

I checked and found the below link where user has mentioned seeing this error and there was no solution to it. 

https://community.ptc.com/t5/ThingWorx-Developers/Unable-to-delete-Valuestream-from-Composer-which-was-created-via/m-p/667936#M45363

 

Here are some of my findings.

-There are no ghost entites checked it with getghostentities service and I am using Administrator credentials which has access to all the things and services.

- When I try to restart MyStream from composer, it throws an error showing invalid persistence provided (ThingworxPersistenceProvider) or when I try to set persistence provider using SetPersistenceProvider service it throws an error that thing is not running.

- To my surprise this persistence provider is the one which I have used so far and the fun part is, if I remove that persistence provider and re-attach it (manually) followed by saving the thing, I was able to delete it! This I have confirmed 10-15 times. I am using thingworx 9.1

 

Please let me know what to do about this?

 

3 replies

5-Regular Member
March 4, 2021

When you create your value stream thing through REST, pass your persistence provider in the body along with other parameters like:

"persistenceProvider": "ThingworxPersistenceProvider"

Once you get 200 for create thing, then execute EnableThing and RestartThing from REST. This way you should not face below issues.

 

 

16-Pearl
March 4, 2021

Hi @SO_9699370 

 

When you create a value stream via postman Persistence provider is not provided by default. If you go to composer and open the newly created VS, it asks you to add to persistence provider, without adding it you cannot delete or edit the thing and that's when you get the error Unable to dispose thing. Mentioned the persistence provider in the body of json when creating the VS.

 

Regards,

Sachin Sharma

1-Visitor
March 4, 2021

Hi @SachinSharma  and @mnarang,

 

Thanks for your input, This time I gave the persistence provider in the body (please check below). Then I enabled and restarted the thing, still no luck. While trying to delete manually it gave the error - "[test1] Unable to dispose thing: [test1] null". I got 200OK for all the services I fired in postman.

 

{
"name""test1",
 "thingTemplateName""ValueStream",
"persistenceProvider""ThingworxPersistenceProvider",
"projectName" : "tProject"
}
 
Kind Regards
SO
5-Regular Member
March 4, 2021

Did you do EnableThing and RestartThing from REST client itself or did it manually from composer after creating the thing ?

1-Visitor
March 5, 2021

Hi @mnarang

 

I did it from REST call using postman. 

 

Kind Regards

SO