Skip to content

Commit

Permalink
2091: fix path pattern matching for subprocesses, should be more strict
Browse files Browse the repository at this point in the history
  • Loading branch information
Auris committed May 25, 2016
1 parent 38bb820 commit 7e0ea35
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/Spryker/Zed/Oms/Business/OrderStateMachine/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ protected function buildFinder($fileName)
$finder = $this->getFinder();
$finder->in($this->processDefinitionLocation);
if (strpos($fileName, '/') !== false) {
$finder->path(dirname($fileName));
$finder->path($this->createSubProcessPathPattern($fileName));
$finder->name(basename($fileName));
} else {
$finder->name($fileName);
Expand Down Expand Up @@ -481,4 +481,14 @@ protected function validateFinder(SymfonyFinder $finder, $fileName)
}
}

/**
* @param string $fileName
*
* @return string
*/
protected function createSubProcessPathPattern($fileName)
{
return '/\b' . dirname($fileName) . '\b/';
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<statemachine
xmlns="https://static.spryker.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://static.spryker.com https://static.spryker.com/oms-01.xsd">

<process name="SubProcessA">
<states>
<state name="state b"/>
</states>
</process>
</statemachine>

0 comments on commit 7e0ea35

Please sign in to comment.