-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix properties #251
Fix properties #251
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx @amhudson
@@ -199,7 +204,7 @@ private EventResponse processEvent(CloudEvent<AttributesImpl, JsonNode> event, S | |||
property.setKey("eventId"); | |||
property.setValue(event.getAttributes().getId()); | |||
cloudEventLabels.add(property); | |||
executionRequest.setLabels(cloudEventLabels); | |||
// executionRequest.setLabels(cloudEventLabels); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amhudson how does not setting the labels on a CloudEvent (listener triggered) execution affect the webhook?
ObjectMapper mapper = new ObjectMapper(); | ||
Map<String, String> payloadProperties = | ||
mapper.convertValue(eventData.get("properties"), new TypeReference<Map<String, String>>() {}); | ||
properties.putAll(payloadProperties); | ||
|
||
// properties.put("eventPayload", eventData.toString()); | ||
|
||
WorkflowEntity workflow = workflowService.getWorkflow(workflowId); | ||
|
||
List<KeyValuePair> propertyList = ParameterMapper.mapToKeyValuePairList(properties); | ||
Map<String, WorkflowProperty> workflowPropMap = workflow.getProperties().stream() | ||
.collect(Collectors.toMap(WorkflowProperty::getKey, WorkflowProperty -> WorkflowProperty)); | ||
// Use default value for password-type parameter when user input value is null when executing | ||
// workflow. | ||
propertyList.stream().forEach(p -> { | ||
if (workflowPropMap.get(p.getKey()) != null | ||
&& FieldType.PASSWORD.value().equals(workflowPropMap.get(p.getKey()).getType()) | ||
&& p.getValue() == null) { | ||
p.setValue(workflowPropMap.get(p.getKey()).getDefaultValue()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the parameter resoluton around defaults be resolved in the Workflow Execution Service and not the EventProcessor
* fix properties * remove CE labels * fix workflow password parameters * fix conversion * fix conversion * fix conversion * refactor * fix conversion * fix npe * update property processing * upgrade jacoco version
Closes #
#250
Changelog
New
Changed
Removed
Testing / Reviewing
Tested and verified with
flow.service.workflow 3.4.83