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

ThingWorx Navigate is now Windchill Navigate Learn More

Translate the entire conversation x

Accessing State Definition Style Information via Service

MA8731174
16-Pearl

Accessing State Definition Style Information via Service

Hi ThingWorx Community,

I’m working with a State Definition (project.States.SD) where each state (e.g. taskCreated, taskAssigned, taskInProgress, etc.) has its own display‐style (colors, icons, shapes) configured in Composer:

 

 

 

Right now, to apply those styles at runtime I’ve been hard‑coding the color/icon mappings in my mashup scripts. What I’d really like is to dynamically retrieve the full style definition (all state keys, display names, style palettes, icons, etc.) via a service call.

My questions:

  1. Is there a built‑in ThingWorx service (for example under DefinitionServices or MetadataManager) that returns the complete style configuration for a given State Definition?

  2. If not, is there a recommended pattern or existing code snippet for querying a State Definition’s metadata (including style properties) at runtime?

Any pointers, sample code or best‑practice guidance would be hugely appreciated!

Thanks in advance,

ACCEPTED SOLUTION

Accepted Solutions

let params = { name: "SimpleAlarm", type: "StateDefinitions" };
result = Resources["EntityServices"].ReadEntityAsJSON(params);

 

View solution in original post

1 REPLY 1

let params = { name: "SimpleAlarm", type: "StateDefinitions" };
result = Resources["EntityServices"].ReadEntityAsJSON(params);

 

Announcements


Top Tags