Search in sources :

Example 1 with ResourceDemandingBehaviour

use of org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddCollectionIteratorAction method execute.

@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
    CollectionIteratorAction action = (CollectionIteratorAction) parameters.get("instance");
    ResourceDemandingBehaviour resourceDemandingBehaviour = (ResourceDemandingBehaviour) parameters.get("resourceDemandingBehaviour");
    ServiceEffectSpecification seff = SEFFUtil.getEnclosingSEFF(resourceDemandingBehaviour);
    Parameter parameter = getParameter(action, seff);
    action.setParameter_CollectionIteratorAction(parameter);
}
Also used : ResourceDemandingBehaviour(org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour) CollectionIteratorAction(org.palladiosimulator.pcm.seff.CollectionIteratorAction) Parameter(org.palladiosimulator.pcm.repository.Parameter) ServiceEffectSpecification(org.palladiosimulator.pcm.seff.ServiceEffectSpecification)

Example 2 with ResourceDemandingBehaviour

use of org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddExternalCallAction method getOperationSignature.

private OperationSignature getOperationSignature(ExternalCallAction extCall, HashMap<OperationInterface, OperationRequiredRole> requiredRolesMap) {
    Collection<Object> filter = new ArrayList<Object>();
    filter.add(Repository.class);
    filter.add(OperationInterface.class);
    filter.add(OperationSignature.class);
    Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
    PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, extCall.eResource().getResourceSet());
    dialog.setProvidedService(OperationSignature.class);
    for (Object o : dialog.getTreeViewer().getExpandedElements()) {
        if (// if the current object is not an OperationInterface, skip.
        !(o instanceof OperationInterface))
            continue;
        ResourceDemandingBehaviour rd = extCall.getResourceDemandingBehaviour_AbstractAction();
        ServiceEffectSpecification seff = SEFFUtil.getEnclosingSEFF(rd);
        BasicComponent parent = seff.getBasicComponent_ServiceEffectSpecification();
        // if o is not referenced by any OperationRequiredRole, remove it from the tree viewer
        OperationRequiredRole requiredRole = getOperationRequiredRole(parent.getRequiredRoles_InterfaceRequiringEntity(), (OperationInterface) o);
        if (requiredRole != null)
            requiredRolesMap.put((OperationInterface) o, requiredRole);
        else
            dialog.getTreeViewer().remove(o);
    }
    dialog.open();
    return (OperationSignature) dialog.getResult();
}
Also used : ResourceDemandingBehaviour(org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour) OperationSignature(org.palladiosimulator.pcm.repository.OperationSignature) PalladioSelectEObjectDialog(org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog) ArrayList(java.util.ArrayList) BasicComponent(org.palladiosimulator.pcm.repository.BasicComponent) EObject(org.eclipse.emf.ecore.EObject) ServiceEffectSpecification(org.palladiosimulator.pcm.seff.ServiceEffectSpecification) EReference(org.eclipse.emf.ecore.EReference) OperationInterface(org.palladiosimulator.pcm.repository.OperationInterface) OperationRequiredRole(org.palladiosimulator.pcm.repository.OperationRequiredRole)

Aggregations

ResourceDemandingBehaviour (org.palladiosimulator.pcm.seff.ResourceDemandingBehaviour)2 ServiceEffectSpecification (org.palladiosimulator.pcm.seff.ServiceEffectSpecification)2 ArrayList (java.util.ArrayList)1 EObject (org.eclipse.emf.ecore.EObject)1 EReference (org.eclipse.emf.ecore.EReference)1 PalladioSelectEObjectDialog (org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog)1 BasicComponent (org.palladiosimulator.pcm.repository.BasicComponent)1 OperationInterface (org.palladiosimulator.pcm.repository.OperationInterface)1 OperationRequiredRole (org.palladiosimulator.pcm.repository.OperationRequiredRole)1 OperationSignature (org.palladiosimulator.pcm.repository.OperationSignature)1 Parameter (org.palladiosimulator.pcm.repository.Parameter)1 CollectionIteratorAction (org.palladiosimulator.pcm.seff.CollectionIteratorAction)1