/** * The body method is called on the * instatiated plan instance from the scheduler. */ public void body() { CMSCreateComponent ca = (CMSCreateComponent)getParameter("action").getValue(); IGoal cag = createGoal("cms_create_component"); cag.getParameter("name").setValue(ca.getName()); cag.getParameter("type").setValue(ca.getType()); cag.getParameter("configuration").setValue(ca.getConfiguration()); cag.getParameter("arguments").setValue(ca.getArguments()); cag.getParameter("suspend").setValue(Boolean.valueOf(ca.isSuspend())); cag.getParameter("master").setValue(Boolean.valueOf(ca.isMaster())); cag.getParameter("parent").setValue(ca.getParent()); cag.getParameter("rid").setValue(ca.getResourceIdentifier()); dispatchSubgoalAndWait(cag); ca.setComponentIdentifier((IComponentIdentifier)cag.getParameter("componentidentifier").getValue()); getParameter("result").setValue(new Done(ca)); } }
/** * The body method is called on the * instantiated plan instance from the scheduler. */ public void body() { CMSCreateComponent ca = new CMSCreateComponent(); ca.setType((String)getParameter("type").getValue()); ca.setName((String)getParameter("name").getValue()); ca.setConfiguration((String)getParameter("configuration").getValue()); ca.setArguments((Map)getParameter("arguments").getValue()); ca.setSuspend(((Boolean)getParameter("suspend").getValue()).booleanValue()); ca.setMaster(((Boolean)getParameter("master").getValue()).booleanValue()); ca.setParent((IComponentIdentifier)getParameter("parent").getValue()); ca.setResourceIdentifier((IResourceIdentifier)getParameter("rid").getValue()); IGoal req = createGoal("rp_initiate"); req.getParameter("receiver").setValue(getParameter("cms").getValue()); req.getParameter("action").setValue(ca); req.getParameter("ontology").setValue(SFipa.COMPONENT_MANAGEMENT_ONTOLOGY_NAME); dispatchSubgoalAndWait(req); getParameter("componentidentifier").setValue(((CMSCreateComponent)((Done)req.getParameter("result").getValue()).getAction()).getComponentIdentifier()); } }