Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hello Community,
I was wondering if there is any way to remove a project dependency programmatically in Thingworx?
The situation:
We have one project (Project A) that creates projects (Project B-N) and when it does this, the original project (A) gets this newly created project (B-N) as a dependency.
I am not quite sure why it gets the created project (B-N) as a dependency though, I have asked my colleagues about it for now to cover all of my bases.
But in the meantime, when we want to delete the entire newly created project (B-N), we can delete everything within the project, things and such, but not the project itself because of the dependency on it in project (A).
Any ideas in regards to this?
The easy answer is to go to the "General Information" tab of the project and you'll see a section called "Project Dependencies." The should a box with the dependent project and an X next to the name. If that doesn't work try getting rid of any tags associated with the project, as well. If you're looking for a code solution, you might be able to use the "UpdateProjectDependencies" service in all projects to remove an irrelevant dependency.
Hello,
Unfortunately I need a way to do this in my code and it seems like the "UpdateProjectDependencies" service just does another check if all the dependencies still exist.
I did try to use the "ListExternalDependencies" service. This listed a whole bunch of dependencies. But what I found so strange was that when running it for the "parent" project, it listed dependencies where the child project was using something from the parent project.
I can understand that the child project would have that dependency. But why does the parent project have it as well?
After clearing one of my child projects and running the service on it again, I found:
With the "whereUsed" as:
Is it saying that we have a dependency to the "parent" projects, and because of that dependency we can't delete the project?
I'm a bit lost here...
Thanks,
Jens
Hi @jensc.
We're trying to understand the scenario that would result in the requirement to perform the cleanup. If you are able to eliminate that issue, there would not be a need to perform the cleanup.
Can you please provide details of your use case? It would also be helpful to know which version of ThingWorx you are running.
Regards.
--Sharon
Hello @slangley,
We are building an application that will create site specific "child" projects.
At times these projects might have to be cleaned up (removed), and for this we have built a service to remove all entities within the project and lastly delete the project entity itself.
What I don't really get is how after removing all entities in the project, it can still have dependencies on the parent project.
I think it was PTC that built a utility project for us (or in general?) that also has a kind of project cleanup service which I haven't tested for this purpose yet.
But it might work better as I think it uses some other API's instead of the "normal" - "DeleteX" service.
So perhaps this isn't such a huge issue.
We are running Thingworx 9.3.5
Thanks,
Jens
Hello,
Not sure why, but this issue doesn't seem to occur anymore.
I can't say that we had done any specific changes because of this issue. But perhaps it had been fixed at some point while building the project.
So, sorry but there will likely not be a good resolution for this.
Regards,
Jens