Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jwt-dev] Restricting nodes as children of the main Activity

Hello! I am sending this question to this group at the recommendation of Marc Dutoo (A copy also exists on the JWT community forums.  

Following the lead of the EPC view sample, I have successfully created my own view and have happily been extending the metamodel for some custom needs. I've hit an obstacle that I was hoping someone here might have a workaround for.... Quick background: I created an extension plugin that defines my metamodel (extending off of jwt-we) and have some custom actions (extending from ActivityNode). There is some more subclassing I do from there. For example: ActivityNode <--- TypeA_CustomNode ActivityNode <--- TypeB_CustomNode Similarly, I also extended the StructuredActivityNode: StructuredActivityNode <--- CompositeNode The desired functionality: I would like to be able to create an Activity that I can add nodes of TypeA to, as well as my CompositeNode, but I would like to restrict nodes of TypeB from being drop directly to the main Activity, and constrain them only to the CompositeNode. (Type A can be placed anywhere) Problem: Running through the code it seems because ActivityNode is the superclass, the CreateChild Request is fulfilled by the ScopeLayoutEditPolicy, which, though no fault of its own, only cares about the ActivityNode being added to the Activity. I would love to be able to inject the logic to cancel the command if the ActivityNode is of TypeB, but I can't do that. Is there any combination of EditPolicies or extension points that could realize this type of behavior? Thanks in advance for any help you can offer!!

Back to the top