use of org.obeonetwork.dsl.interaction.Execution in project InformationSystem by ObeoNetwork.
the class InteractionServices method computePredecessorForExecution.
public Execution computePredecessorForExecution(Execution execution) {
// Get the preceding end
List<End> precedingEnds = getPrecedingEnds(execution.getStartingEnd());
// The predecessor is the last Execution found amongst the preceding executions
Execution predecessor = null;
for (End end : precedingEnds) {
if (end.isExecutionEnd() && end.isStartingEnd()) {
predecessor = end.getExecution();
}
}
return predecessor;
}
use of org.obeonetwork.dsl.interaction.Execution in project InformationSystem by ObeoNetwork.
the class ExecutionExecutionPropertiesEditionComponent 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 Execution execution = (Execution) elt;
final ExecutionPropertiesEditionPart executionPart = (ExecutionPropertiesEditionPart) editingPart;
// init values
if (isAccessible(InteractionViewsRepository.Execution.Properties.name))
executionPart.setName(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, execution.getName()));
if (isAccessible(InteractionViewsRepository.Execution.Properties.description))
executionPart.setDescription(EEFConverterUtil.convertToString(EcorePackage.Literals.ESTRING, execution.getDescription()));
// init filters
// init values for referenced views
// init filters for referenced views
}
setInitializing(false);
}
use of org.obeonetwork.dsl.interaction.Execution 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.Execution in project InformationSystem by ObeoNetwork.
the class InteractionServices method computeExecutionDepth.
/**
* Computes the depth of an Execution. If the EObject is not an Execution,
* this method returns 0.
*
* @param eobject the EObject to find the depth if it is an Execution
* @param nbOfColors Total number of colors
* @return the depth if it is an Execution.
*/
public int computeExecutionDepth(EObject eobject, int nbOfColors) {
int executionDepth = 0;
if (eobject instanceof Execution) {
Execution currentExecution = (Execution) eobject;
Participant currentLifeline = currentExecution.getOwner();
End start = currentExecution.getStartingEnd();
EObject eContainer = start.eContainer();
EList<EObject> eContents = eContainer.eContents();
int startIndex = eContents.lastIndexOf(start);
List<EObject> contents = eContents.subList(0, startIndex);
for (EObject obj : contents) {
if (obj instanceof End) {
End end = (End) obj;
if (end.isExecutionEnd()) {
Execution execution = end.getExecution();
if (currentLifeline != null && execution != null && currentLifeline.equals(execution.getOwner())) {
if (execution.getStartingEnd().equals(end)) {
executionDepth++;
} else if (execution.getFinishingEnd().equals(end)) {
executionDepth--;
}
}
}
}
}
}
return getColorDepth(executionDepth, nbOfColors);
}
Aggregations