2 Replies Latest reply on Aug 11, 2017 8:01 AM by jamesm RSS
    vpawar-2 Newbie

    create extensions

    Hi ,

    i was creating my custom ThingWorx extension so i set up my IDE and required JAVA SDK's ,i created a thingworx extension project -> new script function library and build it using gradle build tool. it have one service defined public static String "getResponse()" function in the script function library class.

    On importing the extension in the composer,it shows a new resource however i can't find my script function neither in the resources nor in the snippets tab.

     

     

     

    Thanks

    Vinay

      • Re: create extensions
        carko Apprentice

        Hello, Vinay Pawar.

         

        This article will point you to the Extension Development Help Center and the Extension Development User Guide, depending on the version of ThingWorx you have.

         

        https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS201191

         

        Does that help at all, or have you already consulted the Guide?

         

        -- Craig A.

        • Re: create extensions
          jamesm Creator

          Did you provide the correct annotation for the service you want to expose to TWX? It should look something like this:

           

          @ThingworxServiceDefinition(name = "ServiceName", description = "ServiceDescription")
          @ThingworxServiceResult(name = "result", description = "Result", baseType = "INFOTABLE")
          public InfoTable MethodName(
          @ThingworxServiceParameter(name = "param", description = "", baseType = "JSON") JSONObject json,
          @ThingworxServiceParameter(name = "param", description = "", baseType = "DATASHAPENAME", aspects = {
          "defaultValue:" }) String dataShape,
          @ThingworxServiceParameter(name = "param", description = "", baseType = "STRING", aspects = {
          "defaultValue:" }) String dateFormat,
          @ThingworxServiceParameter(name = "param", description = "", baseType = "LONG", aspects = {
          "defaultValue:" }) Long minDateMilliseconds)
          throws Exception {
          ///your code
          }