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

How to get the code of the javascript service ?

SOLVED
Highlighted
Pearl

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
Highlighted

Re: How to get the code of the javascript service ?

@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
Highlighted

Re: How to get the code of the javascript service ?

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

Highlighted

Re: How to get the code of the javascript service ?

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,...).

Highlighted

Re: How to get the code of the javascript service ?

@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

Highlighted

Re: How to get the code of the javascript service ?

 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. 

Highlighted

Re: How to get the code of the javascript service ?

@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

Highlighted

Re: How to get the code of the javascript service ?

@VladimirRosu ,

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

 

Regards,

Sean

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!