@Override protected BaseElement convertXMLToElement(XMLStreamReader xtr, BpmnModel model) throws Exception { ScriptTask scriptTask = new ScriptTask(); BpmnXMLUtil.addXMLLocation(scriptTask, xtr); scriptTask.setScriptFormat(xtr.getAttributeValue(null, ATTRIBUTE_TASK_SCRIPT_FORMAT)); scriptTask.setResultVariable(BpmnXMLUtil.getAttributeValue(ATTRIBUTE_TASK_SCRIPT_RESULTVARIABLE, xtr)); if (StringUtils.isEmpty(scriptTask.getResultVariable())) { scriptTask.setResultVariable(BpmnXMLUtil.getAttributeValue(ATTRIBUTE_TASK_SERVICE_RESULTVARIABLE, xtr)); } String autoStoreVariables = BpmnXMLUtil.getAttributeValue(ATTRIBUTE_TASK_SCRIPT_AUTO_STORE_VARIABLE, xtr); if (StringUtils.isNotEmpty(autoStoreVariables)) { scriptTask.setAutoStoreVariables(Boolean.valueOf(autoStoreVariables)); } parseChildElements(getXMLElementName(), scriptTask, childParserMap, model, xtr); return scriptTask; }
@Override protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) { ScriptTask task = new ScriptTask(); task.setScriptFormat(getPropertyValueAsString(PROPERTY_SCRIPT_FORMAT, elementNode)); task.setScript(getPropertyValueAsString(PROPERTY_SCRIPT_TEXT, elementNode)); task.setAutoStoreVariables(getPropertyValueAsBoolean(PROPERTY_SCRIPT_AUTO_STORE_VARIABLES, elementNode)); return task; } }
public void setValues(ScriptTask otherElement) { super.setValues(otherElement); setScriptFormat(otherElement.getScriptFormat()); setScript(otherElement.getScript()); setResultVariable(otherElement.getResultVariable()); setAutoStoreVariables(otherElement.isAutoStoreVariables()); } }
public void setValues(ScriptTask otherElement) { super.setValues(otherElement); setScriptFormat(otherElement.getScriptFormat()); setScript(otherElement.getScript()); setResultVariable(otherElement.getResultVariable()); setAutoStoreVariables(otherElement.isAutoStoreVariables()); } }