Solution Contents
A solution must be well-formed to enable its successful deployment onto a ThingWorx platform. The requirements for a well-formed solution include:
One project entity
Other entities assigned to that project by the projectName attribute
One ExtensionPackage entity
Aligned solution metadata between the project, extension entity, and solution
It is a good practice to group entities by type in their own subfolders within the extension zip.
The following fields must have matching values across the different files:
Project Attribute
Extension Attribute
Solution JSON Attribute
Description
groupId
groupId
groupId
String
artifactId
artifactId
artifactId
String
packageVersion
packageVersion
version
String of numbers: major.minor.patch representing the solution’s version
minPlatformVersion
minimumThingWorxVersion
targetPlatformMinVersion
String of numbers: major.minor.patch representing ThingWorx compatibility
name
name
displayName
User-facing name
Zip Structure Details 
See the Best Practices for Packaging and Deploying ThingWorx Solutions topic for the required structure of your extension.
Project Attribute Details 
Your solution must contain a project, defined in an XML document within the entities folder of the ZIP file. In addition to the identifiers and other common attributes determined in Solution Identifiers, your solution must also have the following attributes:
Project Attributes
aspect.isExtension="true"
state="PUBLISHED"
aspect.projectType="Solution"
minPlatformVersion="9.1.0"
publishResult=""
1. Project Types
The projectType field may have values of either Solution or Component, based on where in the Solution Central User Interface you would like to see it. Components are typically used as dependencies for solutions.
2. Publish Result
You may omit or leave the publishResult blank. However, please note that this will cause the “Package” UI of your project entity to display misleading non-data.
If publishResult is present, its details are displayed on the Project’s metadata in ThingWorx Composer. publishResult must be an encoded JSON document that replaces quotation mark characters (") with the string ".
{
"publishResult": {
"statusCode": "200",
"status": "Publish Success",
"message": "Publish Successful",
"publishedAt": timestamp,
"publishedVersion": <your version>,
"version": <your version>
}
}
For example, for the above publishResult, the encoded JSON looks like:
publishResult="{&quot;publishResult&quot;:{&quot;packagedVersion&quot;:&quot;1.0.0&quot;,&quot;publishedVersion&quot;:&quot;&quot;,&quot;publishedAt&quot;:0,&quot;message&quot;:&quot;&quot;,&quot;version&quot;:&quot;1.0.0&quot;,&quot;packagedAt&quot;:1607450572734,&quot;statusCode&quot;:200,&quot;status&quot;:&quot;&quot;}}"
3. Other Properties to Set
All projects for solutions should have aspect.isExtension="true" and state="PUBLISHED".
Assigning Entities to the Project
The XML specification for every ThingWorx entity type includes a projectName attribute.
<Thing
<... other attributes ...>
name="MyThing"
projectName="MySolution"
thingTemplate="GenericThing">
<avatar>
</avatar>
<... other elements ...>
</Thing>
All entities other than the project itself must have their ProjectName attribute set to the name of the project.
Extension Attribute Details 
Your zip must contain a metadata.xml in its root folder. This metadata.xml must contain an ExtensionPackage entity with the attributes listed in Solution Identifiers. No additional attributes are required.
<Entities>
<ExtensionPackages>
<ExtensionPackage
name="Example Solution"
groupId="com.ptc.solutions"
artifactId="example"
packageVersion="1.0.0"
minimumThingWorxVersion="9.1.0"
dependsOn="name:1.0,delimited_by_commas:3.1.4,anotherSolution:2.1"
description="User-facing description"
vendor="Example Company Inc.">
</ExtensionPackage>
</ExtensionPackages>
</Entities>
Solution JSON Attribute Details 
Solution JSON refers to the JSON that is required while calling the Create Solution API.
Was this helpful?