use of org.palladiosimulator.pcm.core.composition.AssemblyContext in project Palladio-Editors-Sirius by PalladioSimulator.
the class AllocationServices method getUndeployedAssemblyContexts.
public Collection<AssemblyContext> getUndeployedAssemblyContexts(Allocation allocation) {
Collection<AssemblyContext> assemblyContexts = allocation.getSystem_Allocation().getAssemblyContexts__ComposedStructure();
Collection<AssemblyContext> result = new ArrayList<AssemblyContext>();
for (AssemblyContext assemblyContext : assemblyContexts) {
if (assemblyContext.getEncapsulatedComponent__AssemblyContext() instanceof SubSystem) {
if (hasDeployedComponents((SubSystem) assemblyContext.getEncapsulatedComponent__AssemblyContext(), allocation)) {
result.add(assemblyContext);
result.addAll(getUndeployedSubAssemblyContexts(assemblyContext, allocation, true));
}
}
}
return result;
}
use of org.palladiosimulator.pcm.core.composition.AssemblyContext in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddAssemblyContext method execute.
@Override
public void execute(final Collection<? extends EObject> selections, final Map<String, Object> parameters) {
final Object parameter = parameters.get(NEW_ASSEMBLY_CONTEXT);
if (parameter == null || !(parameter instanceof AssemblyContext)) {
return;
}
final AssemblyContext assemblyContext = (AssemblyContext) parameter;
final RepositoryComponent repositoryComponent = getRepositoryComponent(assemblyContext);
if (repositoryComponent != null) {
assemblyContext.setEncapsulatedComponent__AssemblyContext(repositoryComponent);
assemblyContext.setEntityName("Assembly_" + repositoryComponent.getEntityName());
}
}
Aggregations