Skip to content

Commit

Permalink
Added generation of methods for instance specifications
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasfruehwirth committed Apr 8, 2021
1 parent 61f5e70 commit 68dd5b1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,17 @@ mapping UML::InstanceSpecification::instanceSpecification2OPCUAObject(inout node
)->map propertySlot2UAVariable(result);

// transform primitive-type-properties of the corresponding class that are not defined as slots
// do the same for methods
// and repeat this for all superclasses
var element := classifier;
while(element <> null) {
// add properties
nodeset.uAVariable += element.ownedElement->selectByType(UML::Property)->select(
p | p.type.oclIsKindOf(UML::PrimitiveType) and self.slot.definingFeature->excludes(p)
)->map property2UAVariable(result);

// add methods
nodeset.uAMethod += element.ownedElement->selectByType(UML::Operation)->map operation2UAMethod(result, nodeset);

// if the class inherits from another class, also the properties of the parent class need to be added to the uanode
if(element.generalization->size() > 0 and element.generalization->asList()->first().general.oclIsTypeOf(UML::Class)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mapping UML::Operation::operation2UAMethod(inout parent : OPCUA::UANode, inout n
log("operation2UAMethod for UML element " + self.name);

// set attributs of the OPCUA::UAMethod
nodeId := self.createNodeId();
nodeId := self.createNodeId(false);
browseName := self.createBrowseName();
displayName := displayName := object OPCUA::LocalizedText{value := browseName};

Expand Down

0 comments on commit 68dd5b1

Please sign in to comment.