Skip to content
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

Bug/service task variable #233

Merged
merged 2 commits into from
Sep 29, 2022
Merged

Bug/service task variable #233

merged 2 commits into from
Sep 29, 2022

Conversation

jbirddog
Copy link
Contributor

Fixes a bug reported by natalia/popster where a variable from a script task was not being evaluated properly for use in the service task. I had a bad feeling about that repr that was on main. This fixes the issue and uses the bpmn diagram from staging as the test case.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Collaborator

@danfunk danfunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need to require folks to quote their values if they want to include strings - but having good error messages here is going to be critical -- we need to fail fast and clean - and explain that you misspelled "my_ver" and you meant to say "my_var", and not just pass along the string "my_ver" to the service, where the failure is going to make little sense to anyone.

param['value'] = task.workflow.script_engine.evaluate(task,
param['value'])
except:
pass
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry about swallowing an error here - it may make debugging a problem with parameters very hard to track down. If someone misspells a variable name, how will they now what was wrong?

@danfunk danfunk merged commit 98d0115 into main Sep 29, 2022
@jbirddog jbirddog deleted the bug/service_task_variable branch October 4, 2022 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants