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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

How to get the code of the javascript service ?

seanccc
17-Peridot

How to get the code of the javascript service ?

Hi,

 

I want to implement a custom code analyzer for the javascript service (something like finding the dependent Thing in a service) .  So Is it possible to get the code of the javascript service by calling a javascript service ? 

 

Regards,

Sean

1 ACCEPTED SOLUTION

Accepted Solutions

@seanccc I understand what you are aiming to create. It can be done as Carles said, for sure, and yes, it can be feasible if you know the XML export file structure (which is not guaranteed to always remain the same between versions, beware of this).

 

I am not 100% sure if this will/can be useful for you, but be aware that this feature is present in ThingWorx 8.5 as part of Creating  a package for Solution Central (SC). It's being run as part of the Package creation process to ensure that you don't deploy incomplete packages. When you select a Project, this feature will scan all the Project entities and provide you with a list of what's missing and where and allow you to fix all these issues via a single button.

 

As a side note, you can create Packages (=Extensions) that will be stored in a FileSystemRepository even if you are not connected to SC.

If you have the chance to use 8.5, that I believe it could be a good option.

View solution in original post

6 REPLIES 6
slangley
23-Emerald II
(To:seanccc)

Hi @seanccc.

 

Is it that you need a way to debug?  Are you having an issue?  We assume you have access to composer which would allow you to see the code, so we're not clear on the problem.

 

Please provide further details so we can assist.

 

Regards.

 

--Sharon

Without knowing exactly what you want to achieve. Usually the best way to find things on ThingWorx javascript server side code, it's to export as source control and use text like search on it. Even you can do it with ThingWorx itself if you don't want to use search in files text tools (Notepad++, Sublime Text, Visual Studio Code,...).

seanccc
17-Peridot
(To:seanccc)

@CarlesColl @slangley ,

I want to create a service in a thing to analyze the dependency of the other service during runtime.  For example,  the service I created is "analyzeDependency", it has two input parameters: ThingName and ServiceName.  Running "analyzeDependency" will return the dependent things(and the recursive dependent things) for the specified service.  Is it feasible ? 

 

Regards,

Sean

 As said, you can trigger Export To Source Code on a ThingWorx File Repository, and parse XML files in order to search whatever you want. 

@seanccc I understand what you are aiming to create. It can be done as Carles said, for sure, and yes, it can be feasible if you know the XML export file structure (which is not guaranteed to always remain the same between versions, beware of this).

 

I am not 100% sure if this will/can be useful for you, but be aware that this feature is present in ThingWorx 8.5 as part of Creating  a package for Solution Central (SC). It's being run as part of the Package creation process to ensure that you don't deploy incomplete packages. When you select a Project, this feature will scan all the Project entities and provide you with a list of what's missing and where and allow you to fix all these issues via a single button.

 

As a side note, you can create Packages (=Extensions) that will be stored in a FileSystemRepository even if you are not connected to SC.

If you have the chance to use 8.5, that I believe it could be a good option.

@VladimirRosu ,

Thank you for the hint,  yes we're in 8.5 and will try this option. 

 

Regards,

Sean

Top Tags