/************************************************************************** * CreateItemFromDescription * * $Workfile$ * $Revision: 1.47 $ * $Date: 2005/10/13 08:13:58 $ * * Copyright (C) 2001 CERN - European Organization for Nuclear Research * All rights reserved. **************************************************************************/ package com.c2kernel.lifecycle.instance.predefined.agent; import com.c2kernel.common.AccessRightsException; import com.c2kernel.common.InvalidDataException; import com.c2kernel.common.ObjectAlreadyExistsException; import com.c2kernel.common.ObjectNotFoundException; import com.c2kernel.entity.CorbaServer; import com.c2kernel.entity.agent.ActiveEntity; import com.c2kernel.lifecycle.instance.predefined.item.CreateItemFromDescription; import com.c2kernel.lookup.AgentPath; import com.c2kernel.lookup.RolePath; import com.c2kernel.process.Gateway; import com.c2kernel.utils.Logger; /************************************************************************** * * @author $Author: abranson $ $Date: 2005/10/13 08:13:58 $ * @version $Revision: 1.47 $ **************************************************************************/ public class CreateAgentFromDescription extends CreateItemFromDescription { public CreateAgentFromDescription() { super(); } /** * Params: *
  1. 1: new Agent name
  2. *
  3. 2...: Roles to assign to the agent. Must already exist. * @see com.c2kernel.lifecycle.instance.predefined.item.CreateItemFromDescription#runActivityLogic(com.c2kernel.lookup.AgentPath, int, int, java.lang.String) */ @Override protected String runActivityLogic(AgentPath agent, int itemSysKey, int transitionID, String requestData) throws InvalidDataException { String[] input = getDataList(requestData); String newName = input[0]; 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