Skip to main content
17-Peridot
April 17, 2023
Solved

Importing project as extension

  • April 17, 2023
  • 3 replies
  • 2585 views

Hello community,

 

I wanted to try importing my latest project into a new platform using the extension method that I have heard about.

For those who do not know what I mean, there is a way to import a project created on thingworx onto another platform as an extension. This has several benefits like you can make entities non-editable and when upgrading versions old entities are not left on the platform.

 

Anyway, while trying this I ran into an issue that seems to be quite old.

"Attribute 'aspect.show' is not allowed to appear in element 'FieldDefinition'." - as well as other similar errors like aspect.isIndexed.

 

I tried to look up some fixes for it and found this post from a few years back.

Now, in this post it is said that if you are going to import something in in a way other than the "import from source control" way, then you should export your entities using the "normal" export function.

 

It also says the same thing in this support article, although it is also from a few years back.

 

I tried this, however the "aspect.show" property is still there in the field definition. 

And I still get the same error while trying to import my project as an extension.

 

I do not see it feasible to manually remove these different aspects either as most (perhaps not all) are needed.

Eventually I'll probably open a case with PTC, but before that I thought I'd throw the question out there.

 

Thanks,

Jens

Best answer by jensc

Hello Community,

 

One final update.

PTC support found the issue. We had used a reserved name in one of our data shapes:

jensc_0-1682686098936.png

"ThingShape" is apparently a reserved word by the platform.

The error message was not very clear so the PTC support has reported this to R&D so we can only hope this will be prevented in future releases.

 

Regards,

Jens

3 replies

jensc17-PeridotAuthor
17-Peridot
April 17, 2023

Hello,

 

Forgot to say what versions I am using.
I have exported my project as source control from a 9.3.5 platform.

My first test was to import it into a 9.1 platform, which I figured perhaps wasn't the best test as there could be some compatibility issues.

So I tried it on a 9.3.4 platform but ended up with a different yet similar error message:

"Element 'ThingShape' cannot have character [children], because the type's content type is element-only."

 

 When checking my "ThingShape" element in the entity that fails it looks like:

<ThingShape>
 <PropertyDefinitions></PropertyDefinitions>
 <ServiceDefinitions></ServiceDefinitions>
 <EventDefinitions></EventDefinitions>
 <ServiceMappings></ServiceMappings>
 <ServiceImplementations></ServiceImplementations>
 <Subscriptions></Subscriptions>
</ThingShape>

 

Not really sure why it wouldn't work though...

 

Thanks,

Jens

Community Manager
April 18, 2023

Hi @jensc.

 

What version(s) of java are you running on each system?  When you did the export, did you export as a project and if so, did you include dependencies?  Also, did you validate that it works on a 9.3.5 system?

 

Regards.

 

--Sharon

jensc17-PeridotAuthor
17-Peridot
April 19, 2023

Hello @slangley,

 

We are running these java versions:

9.1.x platform: jdk11.0.16_8

9.3.4 platform: jdk11.0.16_9

 

When I exported the project I exported it as "Source Control Entities":

jensc_0-1681884270901.png

 

I also tried it on a 9.3.5 platform but got the same error.

Just as a clarification, the error doesn't come when trying to import the extension, it comes when I try to validate the extension so I haven't tried importing it in case something breaks.

 

One of my colleagues has managed to do this and somewhere in the back of my mind I remember him saying that we needed to modify the entity files in some way to make this work. I just don't remember exactly what he said and he is on sick leave currently so I can't ask him.

 

If we can't figure it out I'll just wait until my colleague is back and check with him what it is that I forgot. If that still doesn't fix it I think I'll open a support ticket.

 

Thanks,

Jens

jensc17-PeridotAuthor
17-Peridot
April 27, 2023

Hello,

 

I wanted to make an update on this.

My case with PTC is still open and is being looked into.

I will update this post again once the case is resolved.

 

Regards,

Jens

jensc17-PeridotAuthorAnswer
17-Peridot
April 28, 2023

Hello Community,

 

One final update.

PTC support found the issue. We had used a reserved name in one of our data shapes:

jensc_0-1682686098936.png

"ThingShape" is apparently a reserved word by the platform.

The error message was not very clear so the PTC support has reported this to R&D so we can only hope this will be prevented in future releases.

 

Regards,

Jens

19-Tanzanite
April 28, 2023

Thank you @jensc, very useful.