use of org.obeonetwork.dsl.interaction.StateInvariant in project InformationSystem by ObeoNetwork.
the class DeleteServices method getStateInvariantsForParticipant.
private List<StateInvariant> getStateInvariantsForParticipant(Participant participant) {
Interaction interaction = (Interaction) participant.eContainer();
List<StateInvariant> result = new ArrayList<StateInvariant>();
for (StateInvariant stateInvariant : interaction.getStateInvariants()) {
if (participant.equals(stateInvariant.getOwner())) {
result.add(stateInvariant);
}
}
return result;
}
use of org.obeonetwork.dsl.interaction.StateInvariant in project InformationSystem by ObeoNetwork.
the class StateInvariantStateInvariantPropertiesEditionComponent method initPart.
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.component.IPropertiesEditionComponent#initPart(java.lang.Object, int, org.eclipse.emf.ecore.EObject,
* org.eclipse.emf.ecore.resource.ResourceSet)
*/
public void initPart(Object key, int kind, EObject elt, ResourceSet allResource) {
setInitializing(true);
if (editingPart != null && key == partKey) {
editingPart.setContext(elt, allResource);
final StateInvariant stateInvariant = (StateInvariant) elt;
final StateInvariantPropertiesEditionPart stateInvariantPart = (StateInvariantPropertiesEditionPart) editingPart;
// init values
if (isAccessible(InteractionViewsRepository.StateInvariant.Properties.name))
stateInvariantPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, stateInvariant.getName()));
if (isAccessible(InteractionViewsRepository.StateInvariant.Properties.description))
stateInvariantPart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, stateInvariant.getDescription()));
// init filters
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.obeonetwork.dsl.interaction.StateInvariant in project InformationSystem by ObeoNetwork.
the class InteractionServices method computePredecessorForStateInvariant.
public StateInvariant computePredecessorForStateInvariant(StateInvariant stateInvariant) {
// Get the preceding end
List<End> precedingEnds = getPrecedingEnds(stateInvariant.getStartingEnd());
// The predecessor is the last StateInvariant found amongst the preceding state invariants
StateInvariant predecessor = null;
for (End end : precedingEnds) {
if (end.isStateInvariantEnd() && end.isStartingEnd()) {
predecessor = end.getStateInvariant();
}
}
return predecessor;
}
Aggregations