Use of Structured Value Types

Moderator: Moderators

Use of Structured Value Types

Postby alvin.murphy@navy.mil » Tue May 02, 2017 2:34 pm

Our team has an executable model that currently uses blocks to capture collections of data during the simulation. However, I'd like to switch to valueTypes to make our model outputs align with the sysML standard -- assuming that I'm properly interpreting the standard. See below:

Examples4Forum_ValueTypes.png


I discovered during the conversion process that using the valueType created an error when attempting to create an object with tempObj = ALH.createObject("StructuredValueType")

java.lang.NullPointerException: java.lang.NullPointerException: project cannot be null. in <script> at line number XX

In the Simulation ToolKit Users Guide there's a section that discussed the use of value types.

"If you want to have an executable SysML
model, you have to make your custom value types inherited from the SysML primitive value types, including
Complex, Real, Integer, Boolean, and String."

Can you clarify? Will I be able to use a structured value type?
You do not have the required permissions to view the files attached to this post.
alvin.murphy@navy.mil
Forum Newbie
Forum Newbie
 
Posts: 8
Posts Rating:0
Joined: Thu Mar 23, 2017 7:16 am

Re: Use of Structured Value Types

Postby arnon_l » Wed May 03, 2017 1:42 am

Hello,

The user guide is not updated, sorry, we will fix that.

For now, we can automatically create the objects of structured value types in the value initialization phase when starting the execution, but still cannot do during the execution as you did (using ALH.createObject()). ALH.createObject() (or CreateObjectAction) only create the object of Class/Block, not DataType/ValueType.

However, if you want to create the object of structured value types during the execution, you can use a workaround as in the "test.mdzip", it uses ValueSpecification that value is InstanceSpecification of the structured value type.

Kind regards,
You do not have the required permissions to view the files attached to this post.
arnon_l
Customer Support
Customer Support
 
Posts: 78
Posts Rating:9
Joined: Thu Aug 30, 2012 3:39 am

Re: Use of Structured Value Types

Postby alvin.murphy@navy.mil » Wed May 10, 2017 3:00 pm

That worked! Thanks!
alvin.murphy@navy.mil
Forum Newbie
Forum Newbie
 
Posts: 8
Posts Rating:0
Joined: Thu Mar 23, 2017 7:16 am


Return to Cameo Simulation Toolkits

Who is online

Users browsing this forum: No registered users and 0 guests