+ private AttributeDesignatorType generateAttributeDesignatorDataType(String functionKey) {
+ AttributeDesignatorType attributeDesignator = new AttributeDesignatorType();
+ switch (functionKey.toLowerCase()) {
+ case "integer":
+ attributeDesignator.setDataType(INTEGER_DATATYPE);
+ break;
+ default:
+ attributeDesignator.setDataType(STRING_DATATYPE);
+ }
+ return attributeDesignator;
+ }
+
+ private ApplyType generateApplyTypeDataType(String functionKey) {
+ ApplyType applyType = new ApplyType();
+ switch (functionKey.toLowerCase()) {
+ case "integer":
+ applyType.setFunctionId(FUNTION_INTEGER_ONE_AND_ONLY);
+ break;
+ default:
+ applyType.setFunctionId(FUNCTION_STRING_ONE_AND_ONLY);
+ }
+ return applyType;
+ }
+
+ private AttributeValueType generateAttributeValueTypeDataType(String functionKey) {
+ AttributeValueType applyType = new AttributeValueType();
+ switch (functionKey.toLowerCase()) {
+ case "integer":
+ applyType.setDataType(INTEGER_DATATYPE);
+ break;
+ default:
+ applyType.setDataType(STRING_DATATYPE);
+ }
+ return applyType;
+ }
+
+ private void applyTwoTextFieldRuleAttribute(ApplyType decisionApply, String value1, String functionKey) {
+ decisionApply.getExpression()
+ .add(new ObjectFactory().createApply(generateApplyTypeDataType(value1, functionKey)));
+ decisionApply.getExpression()
+ .add(new ObjectFactory().createApply(generateApplyTypeDataType(value1, functionKey)));
+ }
+
+ private ApplyType generateApplyTypeDataType(String value1, String functionKey) {
+ ApplyType innerApply = generateApplyTypeDataType(functionKey);
+ AttributeDesignatorType attributeDesignator = generateAttributeDesignatorDataType(functionKey);
+
+ attributeDesignator.setCategory(CATEGORY_RESOURCE);
+ // Here set actual field values
+ attributeDesignator.setAttributeId(value1.contains("resource:") ? value1.substring(9) : value1.substring(8));
+ innerApply.getExpression().add(new ObjectFactory().createAttributeDesignator(attributeDesignator));
+ return innerApply;
+ }
+