Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Papyrus static profile Java does not detect stereotypes applied to imported package element(Papyrus profile issue)
Papyrus static profile Java does not detect stereotypes applied to imported package element [message #1837675] Thu, 04 February 2021 05:42 Go to next message
Deniz Eren is currently offline Deniz ErenFriend
Messages: 68
Registered: March 2014
Member
Problem found regarding Papyrus static profile generated Java; OCL expression does not detect stereotypes applied to imported package elements.

Please find attached tar file containing example Papyrus static profile project "com.validationproblem.profile" and application "ValidationProblemApp" model ValidationProblem7.tar.gz.

index.php/fa/39931/0/

The profile code com.validationproblem.profile contains the resources directory, which contains a profile directory with ValidationProblem.profile and a library directory with ValidationProblem-Library models.

The ValidationProblem-Library uml model applies the ValidationProblem.profile and defines a single class called LibraryChicken with the stereotype Chicken applied to it.

The application project ValidationProblemApp defines several classes that either apply the stereotype Chicken or Duck; one of the Chicken applied classes however is the LibraryChicken that is imported from the ValidationProblem-Library.

The profile com.validationproblem.profile defines the Farm stereotype with a number of derived properies, that are summarised here and you can find in the attached tar file projects:
/animal: Animal [0..*]
let supplierElement : Set(UML::NamedElement) =
    Has.allInstances()->select(base_Dependency.client->includes(self.base_NamedElement)).base_Dependency.supplier->asSet()
    in Animal.allInstances()->select(supplierElement->includes(base_NamedElement))

/chicken: Chicken [0..*]
self.animal->selectByKind(Chicken)

/duck: Duck [0..*]
self.animal->selectByKind(Duck)

/allAnimals: NamedElement [0..*]
Has.allInstances()->select(base_Dependency.client->includes(self.base_NamedElement)).base_Dependency.supplier->asSet()

/allAnimalsEverywhere: Animal [0..*]
Animal.allInstances()


In the ValidationProblemApp we have defined classes:
farm <<Farm>> -> chicken1 <<Chicken>>
farm <<Farm>> -> chicken2 <<Chicken>>
farm <<Farm>> -> LibraryChicken <<Chicken>>
farm <<Farm>> -> duck1 <<Duck>>


I have represented Dependency elements with stereotype "Has" applied as "->" above.

In the ValidationProblemApp we can see that the stereotype derived properies have the following values:
/animal: Animal [0..*] = {chicken1, chicken2, duck1}
/chicken: Chicken [0..*] = {chicken1, chicken2}
/duck: Duck [0..*] = {duck1}
/allAnimals: NamedElement [0..*] = {chicken1, duck1, LibraryChicken, chicken2}
/allAnimalsEverywhere: Animal [0..*] = {chicken1, chicken2, duck1}


As you can see all this is pointing to the fact that the OCL expression Animal.allInstance() does not return "LibraryChicken"!

Note: ValidationProblem-Library Package is imported as PackageImport and class LibraryChicken is imported as ElementImport to no avail - still LibraryChicken doesn't get discovered by Animal.allInstances().



Best regards,
Deniz
Re: Papyrus static profile Java does not detect stereotypes applied to imported package element [message #1837676 is a reply to message #1837675] Thu, 04 February 2021 05:42 Go to previous message
Deniz Eren is currently offline Deniz ErenFriend
Messages: 68
Registered: March 2014
Member
Bugzilla ticket created: https://bugs.eclipse.org/bugs/show_bug.cgi?id=570894
Previous Topic:Static profile issue generating Java with multiple redefined properties of the same extension type
Next Topic:Static profile OCL expressions referring to enumeration literals cause "contains a bad value&qu
Goto Forum:
  


Current Time: Fri Apr 26 18:15:52 GMT 2024

Powered by FUDForum. Page generated in 0.04973 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top