private void addJsonParameters( String propertyName, List<IOParameter> parameterList, ObjectNode propertiesNode) { ObjectNode parametersNode = objectMapper.createObjectNode(); ArrayNode itemsNode = objectMapper.createArrayNode(); for (IOParameter parameter : parameterList) { ObjectNode parameterItemNode = objectMapper.createObjectNode(); if (StringUtils.isNotEmpty(parameter.getSource())) { parameterItemNode.put(PROPERTY_IOPARAMETER_SOURCE, parameter.getSource()); } else { parameterItemNode.putNull(PROPERTY_IOPARAMETER_SOURCE); } if (StringUtils.isNotEmpty(parameter.getTarget())) { parameterItemNode.put(PROPERTY_IOPARAMETER_TARGET, parameter.getTarget()); } else { parameterItemNode.putNull(PROPERTY_IOPARAMETER_TARGET); } if (StringUtils.isNotEmpty(parameter.getSourceExpression())) { parameterItemNode.put( PROPERTY_IOPARAMETER_SOURCE_EXPRESSION, parameter.getSourceExpression()); } else { parameterItemNode.putNull(PROPERTY_IOPARAMETER_SOURCE_EXPRESSION); } itemsNode.add(parameterItemNode); } parametersNode.put("totalCount", itemsNode.size()); parametersNode.put(EDITOR_PROPERTIES_GENERAL_ITEMS, itemsNode); propertiesNode.put(propertyName, parametersNode); }
public CallActivityBehavior createCallActivityBehavior(CallActivity callActivity) { String expressionRegex = "\\$+\\{+.+\\}"; CallActivityBehavior callActivityBehaviour = null; if (StringUtils.isNotEmpty(callActivity.getCalledElement()) && callActivity.getCalledElement().matches(expressionRegex)) { callActivityBehaviour = new CallActivityBehavior( expressionManager.createExpression(callActivity.getCalledElement()), callActivity.getMapExceptions()); } else { callActivityBehaviour = new CallActivityBehavior( callActivity.getCalledElement(), callActivity.getMapExceptions()); } for (IOParameter ioParameter : callActivity.getInParameters()) { if (StringUtils.isNotEmpty(ioParameter.getSourceExpression())) { Expression expression = expressionManager.createExpression(ioParameter.getSourceExpression().trim()); callActivityBehaviour.addDataInputAssociation( new SimpleDataInputAssociation(expression, ioParameter.getTarget())); } else { callActivityBehaviour.addDataInputAssociation( new SimpleDataInputAssociation(ioParameter.getSource(), ioParameter.getTarget())); } } for (IOParameter ioParameter : callActivity.getOutParameters()) { if (StringUtils.isNotEmpty(ioParameter.getSourceExpression())) { Expression expression = expressionManager.createExpression(ioParameter.getSourceExpression().trim()); callActivityBehaviour.addDataOutputAssociation( new MessageImplicitDataOutputAssociation(ioParameter.getTarget(), expression)); } else { callActivityBehaviour.addDataOutputAssociation( new MessageImplicitDataOutputAssociation( ioParameter.getTarget(), ioParameter.getSource())); } } return callActivityBehaviour; }