50 lines
2.1 KiB
Text
50 lines
2.1 KiB
Text
USES Common/std;
|
|
USES Common/Converters;
|
|
USES Common/CommonUtil;
|
|
USES Common/ModelDataRetreive;
|
|
USES Common/StringUtil;
|
|
|
|
proc main()
|
|
Init();
|
|
info = "UML check STARTED at \t"time()"\n";
|
|
CustomMultiplicityCheck();
|
|
info = "UML check STOPPED at \t"time()"\n";
|
|
end proc
|
|
|
|
proc Init()
|
|
//Language
|
|
setLanguage("SQL");
|
|
mkdir([OutputDir]);
|
|
// setOutput( [OutputDir] "/" "CustomMultiplicityCheck.bat" );
|
|
end proc
|
|
|
|
proc CustomMultiplicityCheck()
|
|
info = "Start Roele multiplicity: "[StartRoleMultiplicity]"\n";
|
|
info = "End Roele multiplicity: "[EndRoleMultiplicity]"\n";
|
|
info = "Assoc Class indicator parameter: " [HasAssocClass] "\n";
|
|
|
|
if ( [HasAssocClass] != _False() and [HasAssocClass] != _True() )
|
|
[HasAssocClass] = _False();
|
|
end if
|
|
info = "Assoc Class indicator: " [HasAssocClass] "\n";
|
|
|
|
info = "/////////////////////////////////////////////////////\n";
|
|
|
|
loop(Instances -> MClass as StartClass Where (getStereotype([StartClass])=="Entity" ) )
|
|
loop( StartClass -> Role as StartRole Where([StartRole.multiplicity] == [StartRoleMultiplicity] ) )
|
|
loop ( StartRole -> MAssociation as Assoc -> MAssociationEnd as EndRole Where ( ([EndRole.multiplicity] == [EndRoleMultiplicity]) and [StartRole.id] < [EndRole.id] ) )
|
|
loop ( EndRole -> MClass as EndClass Where( getStereotype([EndClass]) == "Entity" ) )
|
|
if ( [HasAssocClass] == _False() )
|
|
if ( HasAssociationClass([Assoc]) == "" )
|
|
info = "[" [StartClass.name] "{" [StartRole.name] ":" [StartRole.multiplicity] "}]" "[" [EndClass.name] "{" [EndRole.name]":" [EndRole.multiplicity] "}]\n";
|
|
end if
|
|
else
|
|
if ( HasAssociationClass([Assoc]) != "" )
|
|
info = "[" [StartClass.name] "{" [StartRole.name] ":" [StartRole.multiplicity] "}]" "["[Assoc.name]"]" "[" [EndClass.name] "{" [EndRole.name]":" [EndRole.multiplicity] "}]\n";
|
|
end if
|
|
end if
|
|
end loop
|
|
end loop
|
|
end loop
|
|
end loop
|
|
end proc
|