use of org.contextmapper.dsl.refactoring.ExtractAggregatesByVolatility in project context-mapper-dsl by ContextMapper.
the class ExtractAggregatesByVolatilityRefactoringHandler method executeRefactoring.
@Override
protected void executeRefactoring(CMLResource resource, ExecutionEvent event) {
BoundedContext bc = (BoundedContext) getSelectedElement();
ExtractAggregatesByVolatilityContext refactoringContext = new ExtractAggregatesByVolatilityContext(bc.getAggregates().stream().map(agg -> agg.getLikelihoodForChange()).collect(Collectors.toList()));
new WizardDialog(HandlerUtil.getActiveShell(event), new ExtractAggregatesByVolatilityRefactoringWizard(refactoringContext, executionContext -> {
ExtractAggregatesByVolatility ar = new ExtractAggregatesByVolatility(bc.getName(), executionContext.getVolatilityToExtract());
return finishRefactoring(ar, resource, event);
})).open();
}
use of org.contextmapper.dsl.refactoring.ExtractAggregatesByVolatility in project context-mapper-dsl by ContextMapper.
the class ExtractAggregatesByVolatilityCommand method getRefactoring.
@Override
protected SemanticCMLRefactoring getRefactoring(ExecuteCommandParams params) {
JsonArray refactoringParams = (JsonArray) params.getArguments().get(1);
JsonPrimitive boundedContextName = (JsonPrimitive) refactoringParams.get(0);
JsonPrimitive volatilityToExtract = (JsonPrimitive) refactoringParams.get(1);
return new ExtractAggregatesByVolatility(boundedContextName.getAsString(), Volatility.valueOf(volatilityToExtract.getAsString()));
}
Aggregations