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?
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:
In the model where the library is imported, the abstract operations are overwritten with the specific class:
Since i get also the PS-State class from the import, i can just create it with the PersistentStateAdapater:
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.