Class ThingWorxHelper

java.lang.Object
com.ptc.qualitymanagement.regmstr.util.ThingWorxHelper

public class ThingWorxHelper extends Object
Provides methods for creating ThingWorx things for processing of Regulatory Submissions.

Supported API: true

Extendable: true
  • Method Details

    • createThing

      public static String createThing(RegulatorySubmission regulatorySubmission) throws WTException, WTPropertyVetoException, org.json.JSONException
      Creates a Thingworx thing and sets the remote identifier.

      Thing creation is configured using Type Attributes:
      ThingWorx Service Selector, ThingWorx App Name, ThingWorx App Key, ThingWorx Base URL, ThingWorx Thing Template Name.

      The thing is created using the services CreateThing, EnableThing and Start Thing. If the Thingworx Initialization URL is present the service will be called.

      In production systems the ThingWorx Service Selector and Thingworx App Name should be used to configure secure communication between Windchill and Thingworx. Use ThingWorx App Key in development and Testing for ease of configuration.

      Supported API: true

      Throws:
      WTException
      WTPropertyVetoException
      org.json.JSONException
    • getInitializationURL

      public static String getInitializationURL(RegulatorySubmission submission) throws WTException
      Generates the initialization URL. Created from the Type Attribute Initialization URL Format

      Note: the RegulatorySubmission is not modified by this call

      Supported API: true

      Throws:
      WTException
    • getInitializationPayloadMap

      public static Map<String,Object> getInitializationPayloadMap(RegulatorySubmission submission) throws WTException, org.json.JSONException
      Provide the key value pairs to send with the body of the initialization URL. Created from the Type Attribute Initialization Payload.

      Supported API: true
      Throws:
      WTException
      org.json.JSONException
    • getInitializationPayload

      public static org.json.JSONObject getInitializationPayload(RegulatorySubmission submission) throws WTException, org.json.JSONException
      Returns the content of the Initialization Payload from the the Type definition.

      Supported API: true
      Throws:
      WTException
      org.json.JSONException
    • getRemoteURL

      public static String getRemoteURL(RegulatorySubmission submission) throws WTException
      Generates the Remote URL using the Type Attribute and the remote Identifier of the submission. Create from the Type Attribute Remote URL Format

      Note: the RegulatorySubmission is not modified by this call

      Supported API: true

      Throws:
      WTException
    • getThingName

      public static String getThingName(RegulatorySubmission submission) throws WTException
      Provides the value for the created thing name.

      Uses the Type Attribute ThingWorx Thing Name Prefix and appends a GUID to create a unique name.

      Supported API: true

      Throws:
      WTException