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
Store service task response in task data #227
Conversation
if self.result_variable is not None and len(self.result_variable) > 0: | ||
return self.result_variable | ||
|
||
return f'spiff__{task.task_spec.name}_result' |
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.
do we need to normalize this in any way? can task_spec.name include spaces or hyphens?
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.
Good catch, looks like dashes can be in the name - I'll convert them to underscores.
Kudos, SonarCloud Quality Gate passed! |
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.
Looks good to me.
@@ -11,21 +12,35 @@ | |||
from SpiffWorkflow.bpmn.exceptions import WorkflowTaskExecException | |||
from .BaseTestCase import BaseTestCase | |||
|
|||
# TODO must be a better way to do this | |||
assertEqual = None |
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.
I didn't understand why this was here, checked out the code, ran it, and it doesn't need to be here. What is it for?!?!
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.
asking about the "AssertEqual = None" - but commented on the wrong line.
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.
In the test case setUp, the global is set to self.assertEqual
so that the mock connector can assert its name and params. Didn't realize you could omit this line and the global assertEqual
on line 52 would create the variable.
Supports storing the response of a service task in task data. An optional
resultVariable
attribute is supported for naming the task data key. If one is not specified a variable name will be constructed based off the spec name. Tested via the front end, which after running a sample diagram to hit bamboohr: