diff options
| author | Andrew Branson <andrew.branson@cern.ch> | 2014-09-30 12:28:42 +0200 |
|---|---|---|
| committer | Andrew Branson <andrew.branson@cern.ch> | 2014-09-30 12:28:42 +0200 |
| commit | 8307f06a338b1f73f47e83b94aa64c2241e9baa7 (patch) | |
| tree | e31851213922c3241bcc075d68a092ab12d50c76 /src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/CreateAgentFromDescription.java | |
| parent | 25e0517ffc1db85e2f89318abbec9b5202bb43c0 (diff) | |
Initial properties can be supplied as a marshalled PropertyArrayList as
an optional additional parameter to CreateItem/AgentFromDescription.
Each property supplied must be defined in the property description.
Diffstat (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/CreateAgentFromDescription.java')
| -rw-r--r-- | src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/CreateAgentFromDescription.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/CreateAgentFromDescription.java b/src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/CreateAgentFromDescription.java index 088bee1..780c82e 100644 --- a/src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/CreateAgentFromDescription.java +++ b/src/main/java/com/c2kernel/lifecycle/instance/predefined/agent/CreateAgentFromDescription.java @@ -22,6 +22,7 @@ import com.c2kernel.lookup.AgentPath; import com.c2kernel.lookup.ItemPath;
import com.c2kernel.lookup.RolePath;
import com.c2kernel.process.Gateway;
+import com.c2kernel.property.PropertyArrayList;
import com.c2kernel.utils.Logger;
/**************************************************************************
@@ -48,7 +49,9 @@ public class CreateAgentFromDescription extends CreateItemFromDescription String[] input = getDataList(requestData);
String newName = input[0];
-
+ PropertyArrayList initProps =
+ input.length > 1?getInitProperties(input[1]):new PropertyArrayList();
+
Logger.msg(1, "CreateAgentFromDescription::request() - Starting.");
try {
@@ -87,7 +90,7 @@ public class CreateAgentFromDescription extends CreateItemFromDescription newAgent.initialise(
agent.getSystemKey(),
- Gateway.getMarshaller().marshall(getNewProperties(itemPath, newName, agent)),
+ Gateway.getMarshaller().marshall(getNewProperties(itemPath, initProps, newName, agent)),
Gateway.getMarshaller().marshall(getNewWorkflow(itemPath)),
Gateway.getMarshaller().marshall(getNewCollections(itemPath))
);
|
