Skip to content

Commit

Permalink
added support of discrete values validation
Browse files Browse the repository at this point in the history
  • Loading branch information
xuelianhan007 committed Nov 21, 2024
1 parent d500420 commit 93a010b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,18 +178,18 @@ spec:
- rejected
valueMapping:
CREATING: acknowledged,
ACTIVATING: inProgress,
ACCEPTED: inProgress,
MANUAL: inProgress,
DELETING: inProgress,
DISABLING: inProgress,
DENIED: rejected,
ERROR: failed,
ACTIVE: completed,
DISABLED: disabled,
CANCELLED: disabled,
PENDING: pending,
PENDING_ACCEPTANCE: pending,
ACTIVATING: inProgress
ACCEPTED: inProgress
MANUAL: inProgress
DELETING: inProgress
DISABLING: inProgress
DENIED: rejected
ERROR: failed
ACTIVE: completed
DISABLED: disabled
CANCELLED: disabled
PENDING: pending
PENDING_ACCEPTANCE: pending
DELETED: completed
source: "@{{responseBody.status}}"
sourceLocation: BODY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ spec:
- name: mapper.order.uni.add.bandwidth
title: "Bandwidth of the UNI"
source: "@{{productOrderItem[0].product.productConfiguration.bandwidth}}"
sourceType: discrete
sourceType: customized_enum
sourceValues:
- 1000
- 10000
Expand Down Expand Up @@ -147,21 +147,21 @@ spec:
- partial
- rejected
valueMapping:
progressing: inProgress,
created: acknowledged,
CREATING: acknowledged,
ACTIVATING: inProgress,
ACCEPTED: inProgress,
MANUAL: inProgress,
DELETING: inProgress,
DISABLING: inProgress,
DENIED: rejected,
ERROR: failed,
ACTIVE: completed,
DISABLED: disabled,
CANCELLED: disabled,
PENDING: pending,
PENDING_ACCEPTANCE: pending,
progressing: inProgress
created: acknowledged
CREATING: acknowledged
ACTIVATING: inProgress
ACCEPTED: inProgress
MANUAL: inProgress
DELETING: inProgress
DISABLING: inProgress
DENIED: rejected
ERROR: failed
ACTIVE: completed
DISABLED: disabled
CANCELLED: disabled
PENDING: pending
PENDING_ACCEPTANCE: pending
DELETED: completed
source: "@{{responseBody.status}}"
sourceLocation: BODY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@AllArgsConstructor
public enum MappingTypeEnum {
ENUM("enum"),
DISCRETE("discrete");
CUSTOMIZED_ENUM("customized_enum");
private final String name;
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public Optional<ServerWebExchange> runIt(
String serverUrl = getServerUrl(serverKey);
outputs.put("url", serverUrl);
}

StateValueMappingDto stateValueMappingDto = new StateValueMappingDto();
renderRequestService.parseRequest(facets, stateValueMappingDto);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void checkRequestConstraints(String targetKey, Map<String, Object> inputs
continue;
}
if (MappingTypeEnum.ENUM.getName().equals(mapper.getSourceType())
|| MappingTypeEnum.DISCRETE.getName().equals(mapper.getSourceType())) {
|| MappingTypeEnum.CUSTOMIZED_ENUM.getName().equals(mapper.getSourceType())) {
checkEnumValue(mapper.getSource(), mapper.getTarget(), inputs, mapper.getSourceValues());
} else if (mapper.getTarget() != null && !mapper.getTarget().contains("@{{")) {
checkConstantValue(mapper.getSource(), mapper.getTarget(), inputs);
Expand Down

0 comments on commit 93a010b

Please sign in to comment.