use of org.obeonetwork.dsl.interaction.Interaction in project InformationSystem by ObeoNetwork.
the class InteractionInteractionPropertiesEditionComponent 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 Interaction interaction = (Interaction) elt;
final InteractionPropertiesEditionPart interactionPart = (InteractionPropertiesEditionPart) editingPart;
// init values
if (isAccessible(InteractionViewsRepository.Interaction_.Properties.name))
interactionPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interaction.getName()));
if (isAccessible(InteractionViewsRepository.Interaction_.Properties.description))
interactionPart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, interaction.getDescription()));
// init filters
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.obeonetwork.dsl.interaction.Interaction in project InformationSystem by ObeoNetwork.
the class DeleteServices method getExecutionsForParticipant.
private List<Execution> getExecutionsForParticipant(Participant participant) {
Interaction interaction = (Interaction) participant.eContainer();
List<Execution> result = new ArrayList<Execution>();
for (Execution execution : interaction.getExecutions()) {
if (participant.equals(execution.getOwner())) {
result.add(execution);
}
}
return result;
}
use of org.obeonetwork.dsl.interaction.Interaction in project InformationSystem by ObeoNetwork.
the class DeleteServices method getMessagesForParticipant.
private List<Message> getMessagesForParticipant(Participant participant) {
Interaction interaction = (Interaction) participant.eContainer();
List<Message> result = new ArrayList<Message>();
for (Message message : interaction.getMessages()) {
if (message.getStartingEnd() != null && participant.equals(message.getStartingEnd().getContext())) {
result.add(message);
} else if (message.getFinishingEnd() != null && participant.equals(message.getFinishingEnd().getContext())) {
result.add(message);
}
}
return result;
}
use of org.obeonetwork.dsl.interaction.Interaction in project InformationSystem by ObeoNetwork.
the class DeleteServices method getInteractionUsesForParticipant.
private List<InteractionUse> getInteractionUsesForParticipant(Participant participant) {
Interaction interaction = (Interaction) participant.eContainer();
List<InteractionUse> result = new ArrayList<InteractionUse>();
for (InteractionUse interactionUse : interaction.getInteractionUses()) {
if (interactionUse.getCoveredParticipants().size() == 1 && interactionUse.getCoveredParticipants().contains(participant)) {
result.add(interactionUse);
}
}
return result;
}
use of org.obeonetwork.dsl.interaction.Interaction in project InformationSystem by ObeoNetwork.
the class InteractionServices method isPointedByDestroyMessage.
/**
* Return true if the context is pointed by a DestroyParticipantMessage.
* @param context the context on which is applied the service
* @return boolean, true if the context is pointed by a DestroyParticipantMessage, false otherwise
*/
public boolean isPointedByDestroyMessage(Participant context) {
boolean isPointedByDestroyMessage = false;
Interaction interaction = null;
EObject container = context.eContainer();
while (container != null) {
if (container instanceof Interaction) {
interaction = (Interaction) container;
// loop output
container = null;
} else {
container = container.eContainer();
}
}
if (interaction != null) {
List<Message> messages = interaction.getMessages();
List<DestroyParticipantMessage> destroyParticipantMesssages = new ArrayList<DestroyParticipantMessage>();
for (Message message : messages) {
// Retrieve DestroParticipantMessage
if (message instanceof DestroyParticipantMessage) {
destroyParticipantMesssages.add((DestroyParticipantMessage) message);
}
}
for (DestroyParticipantMessage destroyParticipantMessage : destroyParticipantMesssages) {
// Retrieve the finishingEnd that the context is the same as parameter
if (destroyParticipantMessage.getFinishingEnd().getContext() == context) {
isPointedByDestroyMessage = true;
}
}
}
return isPointedByDestroyMessage;
}
Aggregations