@@ -54,9 +54,10 @@ public function __construct($name, $arguments, $actions)
5454 * Gets the ordered steps including merged waits
5555 *
5656 * @param array $arguments
57+ * @param string $actionReferenceKey
5758 * @return array
5859 */
59- public function getSteps ($ arguments )
60+ public function getSteps ($ arguments, $ actionReferenceKey )
6061 {
6162 $ mergeUtil = new ActionMergeUtil ();
6263 $ args = $ this ->arguments ;
@@ -65,25 +66,26 @@ public function getSteps($arguments)
6566 $ args = array_merge ($ args , $ arguments );
6667 }
6768
68- return $ mergeUtil ->resolveActionSteps ($ this ->getResolvedActionsWithArgs ($ args ), true );
69+ return $ mergeUtil ->resolveActionSteps ($ this ->getResolvedActionsWithArgs ($ args, $ actionReferenceKey ), true );
6970 }
7071
7172 /**
7273 * Function which takes a set of arguments to be appended to an action objects fields returns resulting
7374 * action objects with proper argument.field references.
7475 *
7576 * @param array $arguments
77+ * @param string $actionReferenceKey
7678 * @return array
7779 */
78- private function getResolvedActionsWithArgs ($ arguments )
80+ private function getResolvedActionsWithArgs ($ arguments, $ actionReferenceKey )
7981 {
8082 $ resolvedActions = [];
8183 $ regexPattern = '/{{([\w]+)/ ' ;
8284
8385 foreach ($ this ->parsedActions as $ action ) {
8486 $ varAttributes = array_intersect (self ::VAR_ATTRIBUTES , array_keys ($ action ->getCustomActionAttributes ()));
87+ $ newActionAttributes = [];
8588 if (!empty ($ varAttributes )) {
86- $ newActionAttributes = [];
8789 // 1 check to see if we have pertinent var
8890 foreach ($ varAttributes as $ varAttribute ) {
8991 $ attributeValue = $ action ->getCustomActionAttributes ()[$ varAttribute ];
@@ -98,18 +100,14 @@ private function getResolvedActionsWithArgs($arguments)
98100 $ matches
99101 );
100102 }
101-
102- $ resolvedActions [$ action ->getMergeKey ()] = new ActionObject (
103- $ action ->getMergeKey (),
104- $ action ->getType (),
105- array_merge ($ action ->getCustomActionAttributes (), $ newActionAttributes ),
106- $ action ->getLinkedAction (),
107- $ action ->getOrderOffset ()
108- );
109- } else {
110- // add action here if we do not see any userInput in this particular action
111- $ resolvedActions [$ action ->getMergeKey ()] = $ action ;
112103 }
104+ $ resolvedActions [$ action ->getMergeKey () . $ actionReferenceKey ] = new ActionObject (
105+ $ action ->getMergeKey () . $ actionReferenceKey ,
106+ $ action ->getType (),
107+ array_merge ($ action ->getCustomActionAttributes (), $ newActionAttributes ),
108+ $ action ->getLinkedAction (),
109+ $ action ->getOrderOffset ()
110+ );
113111 }
114112
115113 return $ resolvedActions ;
0 commit comments