SysML-v2-Pilot-Implementation icon indicating copy to clipboard operation
SysML-v2-Pilot-Implementation copied to clipboard

ST6RI-782: Memberships of inherited features are not correctly rendered (PlantUML)

Open himi opened this issue 1 year ago • 2 comments

Since the fix in ST6RI-767 has a problem to find a target of PRelation, the example below:

package TestInheritedPart1 {
    part def Vehicle {
        part powerTrain;
    }
    part vehicle : Vehicle;
}

is wrongly rendered with SHOWINHERIT style as below: image

himi avatar Jun 23 '24 04:06 himi

By this fix, the example above is correctly rendered: Screenshot 2024-06-23 at 12 23 07 AM

himi avatar Jun 23 '24 04:06 himi

Since this fix corrected the algorithm to handle redefinitions, I also checked about it. For example,

package TestRedef2 {
	action a1 {
      	action a11;       	
   	}
   	action a1x {
   		action a110;
   	}
   	action a2 :> a1;
    action a3 :> a2 {
    	action :>> a11;
    }
    action a4 :> a2 {
    	action :>> a11;
    }
    action a5 :> a2;
    action a6 :> a5, a1x {
    	action :>> a11;
    	action :>> a110;
    }
}

is correctly rendered as:

Screenshot 2024-06-23 at 12 25 35 AM

himi avatar Jun 23 '24 04:06 himi

For the TestRedef2 example, the diagram is displayed the same even if the SHOWINHERIT style is off. I think it would actually be clearer in this case if all the a11 redefinition arrows pointed to the a11 symbol in action a1. It really is the case in the abstract syntax that, for all the a11 redefinitions, the actual redefined action is a1::a11, and that's what I would expect to see without SHOWINHERIT. Indeed, even if I change the textual notation to explicitly redefine a1::a11, it still shows the redefinition arrows pointing to the inherited a11 symbols, which is a little confusing, particularly when SHOWINHERIT is off.

How difficult would this be to implement?

seidewitz avatar Jul 18 '24 20:07 seidewitz

Thank you for your valuable suggestion. I think I could do what you requested. Without SHOWINHERITED, the result would be: image

himi avatar Jul 19 '24 05:07 himi

I also want to fix ST6RI-784 here if you are ok because Sandy reported and I would like to fix it quickly. This is actually a silly mistake I made.

himi avatar Jul 19 '24 05:07 himi

I also want to fix ST6RI-784 here if you are ok because Sandy reported and I would like to fix it quickly. This is actually a silly mistake I made.

Sure, add that to the PR.

seidewitz avatar Jul 19 '24 13:07 seidewitz

In order to test redefining redefined target, I slightly improved TestRedef2:

package TestRedef2 {
	action a1 {
      	action a11;       	
   	}
   	action a1x {
   		action a110;
   	}
   	action a2 :> a1;
    action a3 :> a2 {
    	action :>> a11;
    }
    action a4 :> a2 {
    	action :>> a11;
    }
    action a5 :> a4 {
    	action :>> a11;
    }
    action a6 :> a2, a1x {
    	action :>> a11;
    	action :>> a110;
    }
}

The visualization result without SHOWINHERITED is: image and that with SHOWINHERITED is: image

himi avatar Jul 19 '24 13:07 himi

By f8bd28c,

package TestSubsetting1 {
    part p0 {
        perform a1;
        part p01 {
            perform a1.a01;
        }
    }
    action a1 {
        action a01;
    }
}

gives image This correctly renders a subsetting from p0.p01.a01 to p0.a1.a01. (Note that it should be a reference subsetting arrowhead but I need to update PlantUML to add new arrowhead symbols)

himi avatar Jul 19 '24 13:07 himi

Also

package TestSubsetting2 {
    part p0 {
    	part p01 :> p1;
        part p02 {
            part p021 :> p01.p10;
        }
    }
    part p1 {
        part p10;
    }
}

is correctly rendered as: image

himi avatar Jul 19 '24 13:07 himi