From 9c5d6e82b5ce733cf23e4317e3bafaa42c2221ba Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Wed, 1 Oct 2014 21:09:06 +0200 Subject: Collection version support, stored as a new final component of the Collection path. Null version implies "last". --- .../agent/CreateAgentFromDescription.java | 26 +++++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/main/java/com/c2kernel/lifecycle/instance/predefined/agent') 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 780c82e..26856e1 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 @@ -39,8 +39,11 @@ public class CreateAgentFromDescription extends CreateItemFromDescription /** * Params: - *
  1. 1: new Agent name
  2. - *
  3. 2...: Roles to assign to the agent. Must already exist. + *
    1. New Agent name
    2. + *
    3. Description version to use
    4. + *
    5. Comma-delimited Role names to assign to the agent. Must already exist.
    6. + *
    7. Initial properties to set in the new Agent
    8. + *
    * @see com.c2kernel.lifecycle.instance.predefined.item.CreateItemFromDescription#runActivityLogic(com.c2kernel.lookup.AgentPath, int, int, java.lang.String) */ @Override @@ -49,19 +52,20 @@ public class CreateAgentFromDescription extends CreateItemFromDescription String[] input = getDataList(requestData); String newName = input[0]; + String descVer = input[1]; + String roles = input[2]; PropertyArrayList initProps = - input.length > 1?getInitProperties(input[1]):new PropertyArrayList(); + input.length > 3 ? getInitProperties(input[3]):new PropertyArrayList(); Logger.msg(1, "CreateAgentFromDescription::request() - Starting."); try { - if (input.length < 2) - throw new InvalidDataException("Agent should have at least one Role defined on creation"); // check if given roles exist - for(int i=1; i