Duplicate View or Dashboard
This task duplicates a custom view or dashboard under the same parent as the original.
@Bean
public ScriptedTaskDescription duplicateViewDashboard() {
ScriptedTaskDescription task = new ScriptedTaskDescription("DuplicateViewDashboard", "Duplicate View or Dashboard");
task.setDescription("Copies Custom View or Custom Dashboard under the same parent as the original.");
setI18nKeys(task, "DUPLICATE_VIEW_DASHBOARD");
var pathUuid = VariableAccessExpression.of("pathUuid");
task.getScript()
.addStatement(AskInputStatement.ofVariable(pathUuid, true, ParameterTypes.TEXT, "Id of the Custom View/Dashboard to copy"))
.addStatement(ExecuteRoutineStatement
.of(StringExpression.of("com.decisionbrain.gene.DuplicateViewDashboard"))
.withInput(pathUuid));
return task;
}