Search in sources :

Example 1 with StateInvariant

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;
}
Also used : Interaction(org.obeonetwork.dsl.interaction.Interaction) ArrayList(java.util.ArrayList) StateInvariant(org.obeonetwork.dsl.interaction.StateInvariant)

Example 2 with StateInvariant

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);
}
Also used : StateInvariantPropertiesEditionPart(org.obeonetwork.dsl.interaction.parts.StateInvariantPropertiesEditionPart) StateInvariant(org.obeonetwork.dsl.interaction.StateInvariant)

Example 3 with StateInvariant

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;
}
Also used : End(org.obeonetwork.dsl.interaction.End) StateInvariant(org.obeonetwork.dsl.interaction.StateInvariant)

Aggregations

StateInvariant (org.obeonetwork.dsl.interaction.StateInvariant)3 ArrayList (java.util.ArrayList)1 End (org.obeonetwork.dsl.interaction.End)1 Interaction (org.obeonetwork.dsl.interaction.Interaction)1 StateInvariantPropertiesEditionPart (org.obeonetwork.dsl.interaction.parts.StateInvariantPropertiesEditionPart)1