protected void convertElementToJson(ObjectNode propertiesNode, FlowElement flowElement) {
    CallActivity callActivity = (CallActivity) flowElement;
    if (StringUtils.isNotEmpty(callActivity.getCalledElement())) {
      propertiesNode.put(PROPERTY_CALLACTIVITY_CALLEDELEMENT, callActivity.getCalledElement());
    }

    addJsonParameters(PROPERTY_CALLACTIVITY_IN, callActivity.getInParameters(), propertiesNode);
    addJsonParameters(PROPERTY_CALLACTIVITY_OUT, callActivity.getOutParameters(), propertiesNode);
  }
  protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode) {
    CallActivity callActivity = new CallActivity();
    if (StringUtils.isNotEmpty(
        getPropertyValueAsString(PROPERTY_CALLACTIVITY_CALLEDELEMENT, elementNode))) {
      callActivity.setCalledElement(
          getPropertyValueAsString(PROPERTY_CALLACTIVITY_CALLEDELEMENT, elementNode));
    }

    callActivity
        .getInParameters()
        .addAll(convertToIOParameters(PROPERTY_CALLACTIVITY_IN, elementNode));
    callActivity
        .getOutParameters()
        .addAll(convertToIOParameters(PROPERTY_CALLACTIVITY_OUT, elementNode));

    return callActivity;
  }
  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;
  }