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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Write an external data with Java

Janos1987
12-Amethyst

Write an external data with Java

Hi,

 Could anyone tell me how I can write a service with java? It is a simply bool value (true, false) and I found it, but it is not working:

 

$scope.app.mdl.Avtis_BudapestThing.svc.SetAnimation.data = 'true';

 

SetAnimation is the name of the service. If I use a button "click" action then it is working, but I want to write it automatically after some seconds with java.

 

Many Thanks

BJ

 

 

2 REPLIES 2

Hi @Janos1987 ,

I belive you meant js - code. If yes , then the js code should be some thing like this:

 

  
 twx.app.fn.triggerDataService('BudapestThing','SetAnimation',"{data:{\"prop\":true}}")

 

Where 'BudapestThing' is the name of the Thing which defines the service

'SetAnimation' is the service

and true is the value

here 'prop' is the name of the service argument  e.g. iin the definition of the service:

 

2020-02-25_10-55-44.jpg

 

Here in the example below the code if we want to call the service according to the defintion shown in  the the picture above :

 

twx.app.fn.triggerDataService('TestTing-rray','setBoolProp',"{data:{\"prop\":true}}")

 

 

Thank you for your answer, I need more time to test it and give back a detailed report about it.

 

Please be patient.

Janos

Announcements

Top Tags