-
Notifications
You must be signed in to change notification settings - Fork 27
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
fixes issue #13 with passing variables from and to sub-workflows #14
base: master
Are you sure you want to change the base?
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.
I've had a few comments, but more importantly, this misses a test case, or test cases.
src/nodes/sub_workflow.php
Outdated
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* |
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.
Please split white space changes out in a separate commit.
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.
Oops. Sure.
src/nodes/sub_workflow.php
Outdated
$subVariables = []; | ||
foreach ( $execution->getVariables() as $variableName => $data ) { | ||
if ( isset($this->configuration['variables']['in'][$variableName]) ) { | ||
$subVariables[$this->configuration['variables']['in'][$variableName]] = $data; |
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.
Coding standards want the { on a new line on its own, please.
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.
Overlooked that. Uncommon coding style for me. Will be fixed.
@@ -188,9 +195,10 @@ public function execute( ezcWorkflowExecution $execution ) | |||
} | |||
|
|||
// Execution of Sub Workflow has been suspended. | |||
$reverseInVariableMap = array_flip( $this->configuration['variables']['in'] ); |
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.
Why does this need to be flipped?
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.
Given an interactive sub-workflow node which maps x
on the parent workflow to y
on the sub-workflow. The workflow used as sub-workflow now waits for its variable y
to be set.
If sub-workflow is waiting for y
the parent workflow is also waiting for a variable. But the parent is not waiting for y
but for x
because of the mapping. y
is not even a variable known to the parent workflow.
I hope this is somehow understandable...
Regarding the failing test cases: regardless of running against master or the new fix I always get 26 errors and 24 warnings. The warnings are due to deprecations in the mocking API in PHPUnit (when running on PHPUnit 5.7.26) and the errors are: 17 x missing hard dependency on I didn't see any tests that used interactive sub-workflows. |
Hmm. OK. Would you be interested in making the test suite up to par first then? And hook them up to Travis as well? I know little about this component, I am not sure whether @sebastianbergmann is still interested in maintaining it either, so I am going to need some help with this one :-) |
I am not interested in this anymore. |
@derickr I'll fix the test suite sometime next week. I'm not very familiar with the contribution guidelines for What's the required PHP version compatibility for |
Curious, when I run the tests, I get this — nothing about
This is with PHP 7.2.0, and PHPUnit 5.7.22. I don't mind if you add I would suggest you look at the Travis config for Base: https://github.com/zetacomponents/Base/blob/master/.travis.yml And as the lowest version we test on Travis is currently PHP 5.6 (I think because of PHPUnit version requirements), I'm OK with that being the lowest version. If there is no problem to make it work with PHP 5.3, then it would be good if you can at least manually test that once (or at least lint). |
@derickr Do you have the |
Oh yes, I have that checked out next to it. |
@derickr There's now a second PR (#16) that fixes the unit tests and adds the correct |
This pull request fixes the issues described in #13.