X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=plugins%2Forg.argeo.slc.client.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Feditors%2FProcessEditor.java;h=75df4d320407c8c01f1448652def44be3ab2dfca;hb=0ddd1e8df3d2d5e5ee19912934c6d88757cd4f39;hp=71ca6b88d43416442a618a815652841018ebf8d9;hpb=76420da459e9fe47612f77166f5e708648e40ef1;p=gpl%2Fargeo-slc.git diff --git a/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/editors/ProcessEditor.java b/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/editors/ProcessEditor.java index 71ca6b88d..75df4d320 100644 --- a/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/editors/ProcessEditor.java +++ b/plugins/org.argeo.slc.client.ui/src/main/java/org/argeo/slc/client/ui/editors/ProcessEditor.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2012 Mathieu Baudier + * Copyright (C) 2007-2012 Argeo GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,12 +16,12 @@ package org.argeo.slc.client.ui.editors; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.UUID; import javax.jcr.Node; import javax.jcr.NodeIterator; +import javax.jcr.Property; import javax.jcr.RepositoryException; import javax.jcr.Session; @@ -32,8 +32,6 @@ import org.argeo.slc.client.ui.ClientUiPlugin; import org.argeo.slc.client.ui.controllers.ProcessController; import org.argeo.slc.execution.ExecutionModulesManager; import org.argeo.slc.execution.ExecutionProcess; -import org.argeo.slc.execution.ExecutionProcessNotifier; -import org.argeo.slc.execution.ExecutionStep; import org.argeo.slc.jcr.SlcJcrUtils; import org.argeo.slc.jcr.SlcNames; import org.argeo.slc.jcr.SlcTypes; @@ -46,8 +44,7 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.ui.forms.editor.FormEditor; /** Editor for an execution process. */ -public class ProcessEditor extends FormEditor implements - ExecutionProcessNotifier, SlcTypes, SlcNames { +public class ProcessEditor extends FormEditor implements SlcTypes, SlcNames { public final static String ID = ClientUiPlugin.ID + ".processEditor"; private Session session; @@ -122,13 +119,37 @@ public class ProcessEditor extends FormEditor implements } catch (RepositoryException e) { throw new SlcException("Cannot update status of " + processNode, e); } + + // save doSave(null); + try { + // make sure modules are started for all nodes + for (NodeIterator nit = processNode.getNode(SLC_FLOW).getNodes(); nit + .hasNext();) { + Node flowNode = nit.nextNode(); + try { + String flowDefPath = flowNode.getNode(SLC_ADDRESS) + .getProperty(Property.JCR_PATH).getString(); + Node executionModuleNode = flowNode.getSession().getNode( + SlcJcrUtils.modulePath(flowDefPath)); + if (!executionModuleNode.getProperty(SLC_STARTED) + .getBoolean()) + ClientUiPlugin.startStopExecutionModule(modulesManager, + executionModuleNode); + } catch (Exception e) { + ErrorFeedback.show( + "Cannot start execution module related to " + + flowNode, e); + } + } + + // Actually process ExecutionProcess process = processController.process(processNode); Map properties = new HashMap(); properties.put(ExecutionModulesManager.SLC_PROCESS_ID, process.getUuid()); - modulesManager.registerProcessNotifier(this, properties); + // modulesManager.registerProcessNotifier(this, properties); } catch (Exception e) { ErrorFeedback.show("Execution of " + processNode + " failed", e); } @@ -224,12 +245,13 @@ public class ProcessEditor extends FormEditor implements return false; } - public void updateStatus(ExecutionProcess process, String oldStatus, - String newStatus) { - } - - public void addSteps(ExecutionProcess process, List steps) { - } + // public void updateStatus(ExecutionProcess process, String oldStatus, + // String newStatus) { + // } + // + // public void addSteps(ExecutionProcess process, List steps) + // { + // } /** Expects one session per editor. */ public void setSession(Session session) {