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:
Is there a built‑in ThingWorx service (for example under DefinitionServices or MetadataManager) that returns the complete style configuration for a given State Definition?
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,
Solved! Go to Solution.
let params = { name: "SimpleAlarm", type: "StateDefinitions" };
result = Resources["EntityServices"].ReadEntityAsJSON(params);
let params = { name: "SimpleAlarm", type: "StateDefinitions" };
result = Resources["EntityServices"].ReadEntityAsJSON(params);