From bad46b9c4ac8226de56da5367bc7c1bd9797218c Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Thu, 6 Mar 2014 16:24:43 +0100 Subject: AddStepsFromDescription was never used, and probably shouldn't be. It messes with the link between WfDef and Item, and is now removed. --- .../predefined/AddStepsFromDescription.java | 50 ---------------------- .../predefined/PredefinedStepContainer.java | 1 - 2 files changed, 51 deletions(-) delete mode 100644 src/main/java/com/c2kernel/lifecycle/instance/predefined/AddStepsFromDescription.java (limited to 'src/main/java/com/c2kernel') diff --git a/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddStepsFromDescription.java b/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddStepsFromDescription.java deleted file mode 100644 index 30d014c..0000000 --- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/AddStepsFromDescription.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.c2kernel.lifecycle.instance.predefined; - -//Java -import com.c2kernel.common.InvalidDataException; -import com.c2kernel.graph.model.GraphPoint; -import com.c2kernel.lifecycle.CompositeActivityDef; -import com.c2kernel.lifecycle.instance.CompositeActivity; -import com.c2kernel.lifecycle.instance.Workflow; -import com.c2kernel.lookup.AgentPath; -import com.c2kernel.process.Gateway; -import com.c2kernel.utils.Logger; - -public class AddStepsFromDescription extends PredefinedStep -{ - public AddStepsFromDescription() - { - super(); - } - - @Override - protected String runActivityLogic(AgentPath agent, int itemSysKey, - int transitionID, String requestData) throws InvalidDataException { - - - Logger.msg(1, "AddStepsFromDescription::request() - Starting "); - - Workflow lifeCycle = getWf(); - - try - { - Logger.msg(8, "AddStepsFromDescription::request() - data:" + getDataList(requestData)[0]); - lifeCycle.getChildGraphModel().removeVertex(lifeCycle.search("workflow/domain")); - CompositeActivityDef actDef = (CompositeActivityDef) Gateway.getMarshaller().unmarshall(getDataList(requestData)[0]); - CompositeActivity domain = (CompositeActivity)actDef.instantiate(); - lifeCycle.initChild(domain, true, new GraphPoint(150, 100)); - domain.setName("domain"); - domain.setType(actDef.getName()); - lifeCycle.run(agent, itemSysKey); - Gateway.getStorage().put(itemSysKey, lifeCycle, null); - Logger.msg(1, "AddStepsFromDescription::request() - DONE."); - return requestData; - } - catch (Exception ex) - { - Logger.error("AddStepsFromDescription::request() - during unmarshall."); - Logger.error(ex); - throw new InvalidDataException("AddStepsFromDescription::request() - during unmarshall.", ""); - } - } -} diff --git a/src/main/java/com/c2kernel/lifecycle/instance/predefined/PredefinedStepContainer.java b/src/main/java/com/c2kernel/lifecycle/instance/predefined/PredefinedStepContainer.java index 8127113..bfab876 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/PredefinedStepContainer.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/predefined/PredefinedStepContainer.java @@ -17,7 +17,6 @@ public class PredefinedStepContainer extends CompositeActivity predInit("CreateItemFromDescription", "Create a new item using this item as its description", new CreateItemFromDescription()); predInit("AddDomainPath", "Adds a new path to this entity in the LDAP domain tree", new AddDomainPath()); predInit("RemoveDomainPath", "Removes an existing path to this Entity from the LDAP domain tree", new RemoveDomainPath()); - predInit("AddStepsFromDescription", "Creates the domain-specific LifeCycle from a description", new AddStepsFromDescription()); predInit("ReplaceDomainWorkflow", "Replaces the domain CA with the supplied one. Used by the GUI to save new Wf layout", new ReplaceDomainWorkflow()); predInit("AddC2KObject", "Adds or overwrites a C2Kernel object for this Item", new AddC2KObject()); predInit("RemoveC2KObject", "Removes the named C2Kernel object from this Item.", new RemoveC2KObject()); -- cgit v1.2.3