Search in sources :

Example 1 with DataReloader

use of net.sourceforge.processdash.tool.db.DataReloader in project processdash by dtuma.

the class WorkflowMappingManager method saveChangedMappings.

public void saveChangedMappings(Workflow workflow, Workflow target, Map<String, String> changes, Map env) throws WorkflowMappingException {
    // find the project this workflow is associated with, and get a
    // workflow alterer for that project
    String projectId = getProjectIDForWorkflowID(workflow.getId());
    WorkflowMappingAlterer alterer = WorkflowMappingAltererFactory.get((DashboardContext) env.get(TinyCGI.DASHBOARD_CONTEXT), projectId);
    if (alterer == null)
        throw new NotFound("Could not find project for workflow " + workflow.getId());
    // save the requested changes
    alterer.applyChanges(workflow, target, changes);
    // tell the data importer to reload data from this project. (In bridged
    // mode, this will cause it to refresh the project directory.)
    DataImporter.refreshLocation(projectId);
    // ask the warehouse to reload all data, and wait for it to finish
    DatabasePlugin databasePlugin = //
    QueryUtils.getDatabasePlugin((DataContext) env.get(TinyCGI.DATA_REPOSITORY));
    DataReloader reloader = databasePlugin.getObject(DataReloader.class);
    reloader.reloadAllData();
}
Also used : DatabasePlugin(net.sourceforge.processdash.tool.db.DatabasePlugin) DataReloader(net.sourceforge.processdash.tool.db.DataReloader)

Aggregations

DataReloader (net.sourceforge.processdash.tool.db.DataReloader)1 DatabasePlugin (net.sourceforge.processdash.tool.db.DatabasePlugin)1