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

ConfigurationTable in ThingShapes / Where does it show up?

Contributor

ConfigurationTable in ThingShapes / Where does it show up?

Hello,

 

I started to develop some Java-Extensions to solve some issues, that we where not able to solve with pure javascript. For some of these functional modules it would be interesting to have them as ThingShape to enable reuse on different Things.

The Eclipse-Plugin allows me to add a ConfigurationTable to the ThingShape and everything compiles properly.

But when I use this ThingShape, I can not see my ConfigurationTable entries anywhere?

 

Ok my first use example, we would like to have a TimerShape that behaves similar like TimerTemplate:

@ThingworxConfigurationTableDefinitions(tables = {
		@ThingworxConfigurationTableDefinition(name = "Settings", description = "General Settings", isMultiRow = false, ordinal = 0, dataShape = @ThingworxDataShapeDefinition( fields = {
				@com.thingworx.metadata.annotations.ThingworxFieldDefinition(name="updateRate", description="Update rate", baseType="NUMBER", aspects={"defaultValue:60000"}), 
				@com.thingworx.metadata.annotations.ThingworxFieldDefinition(name="enabled", description="Automatically enable timer on startup", baseType="BOOLEAN", aspects={"defaultValue:true"}), 
				@com.thingworx.metadata.annotations.ThingworxFieldDefinition(name="runAsUser", description="User context in which to run event handlers", baseType="USERNAME") 
			}))
		})
public class TimerTS {

//	private static Logger _logger = LogUtilities.getInstance().getApplicationLogger(TimerTS.class);

	public TimerTS() {
		// TODO Auto-generated constructor stub
	}

	@ThingworxServiceDefinition(name = "OnTimerTick", description = "Called by timer each time the it is triggered ...", category = "Timer", isAllowOverride = true )
	@ThingworxServiceResult(name = "Result", description = "", baseType = "NOTHING", aspects = {})
	public void OnTimerTick(
			@ThingworxServiceParameter(name = "Timestamp", description = "\t", baseType = "DATETIME") DateTime Timestamp) {
	}

}

 

 

 

Tags (2)
5 REPLIES 5

Re: ConfigurationTable in ThingShapes / Where does it show up?

Hi @atondorf.

 

Which version of ThingWorx are you running?  It appears this issue was corrected in ThingWorx 8.4.4.

 

Regards.

 

--Sharon

Re: ConfigurationTable in ThingShapes / Where does it show up?

Hi Sharon,

 

we have 8.4.4 and after your comment I tested it with a ThingShape created in the Composer .. it's working.

But still not with my shape created as a JavaExtension in Eclipse. So there must be something wrong with the source code. But it is just blank code created by the eclipse thingworx assistant. 

Re: ConfigurationTable in ThingShapes / Where does it show up?

Hi @atondorf.

 

These guides may help in determining the cause of your issue:

 

Create a Mashup Widget Extension

Create an Extension

 

Regards.

 

--Sharon

 

Re: ConfigurationTable in ThingShapes / Where does it show up?

Hi Sharon,

 

thanks a lot, but I already know these tutorials and I followed them. That's how I get this far, but like most documentation on thingworx, these are on a very basic level. If you go deeper into some details you will mostly hit the wall.

In my special case I want to add the ConfigurationTable to a ThingShape and I already did it in Eclipse, but it does not show up in Thingworx. So there must be something missing in code or the Eclipse Plugin does not do the job correclty.

 

Greetings

 

Andreas

Re: ConfigurationTable in ThingShapes / Where does it show up?

Hello,

 

Just a thought -- what if you try to inherit from Thing or ThingShape class?

 

/ Constantine