bildwelt
E2E FORUM
E2E Bridge E2E Commerce

Persistent State library class polymorphism

E2E Forum Modeling & Development Persistent State library class polymorphism

This topic contains 2 replies, has 2 voices, and was last updated by  hatemp 2 years, 8 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1841

    hatemp
    Participant

    I have created a PersistentState class inside an E2E library module. The PersistentState class is an abstract class, therefore using it from another model requires overriding at least one (abstract) operation.

    I made the class an E2ELibrary class in order to have it present in my library.

    In a new model, I imported the library and I created a new PersistentState class, with the library’s PersistentState class as a base class. I overrided the abstract operation.

    Then I had to create a StateMachine for this persistent state class. I want to start the StateMachine of the base class from this, but the StateMachine of the base class is not available from the library (I also tried to set the E2eLibraryClass stereotype on the StateMachine, but it still didn’t show up).

    Is it possible to perform this kind of action using a E2ELibrary or should I take another approach?

    #1844

    Andi
    Moderator

    Hi,

    i dont know why you cant create the PS-Object with your approach.

     

    However, I solved the same requirement as follows. I assigned a abstract class to the PS class with the abstract operations. The abstract operations are invoke in the state machine at the particular states:

    library

    In the model where the library is imported, the abstract operations are overwritten with the specific class:

    service

    Since i get also the PS-State class from the import, i can just create it with the PersistentStateAdapater:

    createPS

    Regards, Andi

    Attachments:
    You must be logged in to view attached files.
    #1850

    hatemp
    Participant

    Hi Andi,

    Thanks for your reply. Your solution will probably work for me.

    Another approach, which I investigated myself yesterday, is to not use an E2ELibrary, but a MagicDraw module. Then this works directly on the PersistentState class, without the need to assign the additional abstract class.

    Regards, Harald

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.