OCL to ensure consistency between IBDs and Activity Diagrams

Other topics that do not fit in any of categories.

Moderator: Moderators

OCL to ensure consistency between IBDs and Activity Diagrams

Postby ryan.hill@gtri.gatech.edu » Wed Jun 24, 2020 12:51 pm

Hello, new guy to SysML/UML here.

I have been researching validation rules for a task to check type consistency between a port type in an Internal Block Diagram to an Activity Parameter Node in an Activity Diagram to pins in the Activity Diagram.

The activity diagram is related to the IBD via an allocation relationship in a swimlane. The pin(s) I'm interested in are in a given swimlane and have inputs coming from the activity parameter node. My thought process is to start with the pin:

1) Get pin "parent"
2) Get IBD part from allocation relationship
3) Get port type(s) from IBD part
4) Get type from activity parameter node
5) Compare results from (3) and (4).

My first thought was to use OCL, but I'm not sure if the process outlined above is too complicated and should be done using a Binary file instead.

My questions/what I'm looking for are:
- Is there a good resource/tutorial for OCL and creating custom validation rules?
- What would the OCL for the above procedure look like? The resources I have found so far discuss containers and data types in OCL, but not specifics for digging into model components.

Many many thanks!

--Ryan
User avatar
ryan.hill@gtri.gatech.edu
Forum Newbie
Forum Newbie
 
Posts: 17
Posts Rating:0
Joined: Wed Jun 24, 2020 11:25 am
Full name: Ryan Hill

Re: OCL to ensure consistency between IBDs and Activity Diagrams

Postby ogirdor » Fri Jul 17, 2020 8:57 am

Hello Ryan,

not sure about the OCL, but you could visualize what you are looking for in a table:

OclValidation_table.png


Here the activity MyActivity has an input parameter called MyParameter, typed by MyOtherType. The activity is allocated to a block called MyBlock. This block has two ports, one is typed by MyPortType, the other by MyOtherType.

Using a metachain we can easily retrieve a list of all types used by the block ports:
02_OclValidation_script.png


Another one gives us the type used by the input parameter:
01_OclValidation_script.png


A script can be used to compare both and output the result of this comparison:
OclValidation_script.png
You do not have the required permissions to view the files attached to this post.
ogirdor
Forum Beginner
Forum Beginner
 
Posts: 67
Posts Rating:19
Joined: Wed Jun 03, 2020 4:41 am


Return to Other

Who is online

Users browsing this forum: No registered users and 1 guest

cron