public Object putJobValue(String path, Object value) throws ContextException { String[] attributes = SorcerUtil.pathToArray(path); // remove the leading attribute of the current exertion if (attributes[0].equals(getName())) { String[] attributes1 = new String[attributes.length - 1]; System.arraycopy(attributes, 1, attributes1, 0, attributes.length - 1); attributes = attributes1; } String last = attributes[0]; Exertion exti = this; for (String attribute : attributes) { if (((ServiceExertion) exti).hasChild(attribute)) { exti = ((Job) exti).getChild(attribute); if (exti instanceof Task) { last = attribute; break; } } else { break; } } int index = path.indexOf(last); String contextPath = path.substring(index + last.length() + 1); exti.getContext().putValue(contextPath, value); return value; }
public Exertion getComponentExertion(String path) { String[] attributes = SorcerUtil.pathToArray(path); // remove the leading attribute of the current exertion if (attributes[0].equals(getName())) { String[] attributes1 = new String[attributes.length - 1]; System.arraycopy(attributes, 1, attributes1, 0, attributes.length - 1); attributes = attributes1; } Exertion exti = this; for (String attribute : attributes) { if (((ServiceExertion) exti).hasChild(attribute)) { exti = ((CompoundExertion) exti).getChild(attribute); if (exti instanceof Task) { break; } } else { break; } } return exti; }