Skip to content

Commit 452485c

Browse files
committed
Added metadata to 'merge' signal
1 parent fb9a37e commit 452485c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

engine2/ProcChoiceFSM.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,16 @@ var ChoiceLogic = function() {
133133
// if there exists "merge" output, emit the 'merge' control signal first.
134134
// see 'join' process for explanation
135135
if (proc.ctrOuts.merge && outValues.length) { // (don't send the signal if no branches are activated)
136-
var Nj = outValues.length, Nb = Nj;
137-
proc.engine.emitSignals([{"_id": proc.ctrOuts.merge, "data": [{"Nb": Nb, "Nj": Nj}]}],
138-
function(err) { });
136+
var Nj = outValues.length, Nb = Nj,
137+
mergeSig = [{"_id": proc.ctrOuts.merge,
138+
"source": +proc.procId,
139+
"firingId": +firingId,
140+
"data": [{"Nb": Nb, "Nj": Nj}]}];
141+
142+
proc.engine.emitSignals(mergeSig, function(err) { });
139143
//onsole.log("CHOICE EMIT MERGE: " + Nj + " " + Nb, proc.ctrOuts.merge);
140144
}
145+
141146
if (proc.ctrOuts.next) { // emit "next" signal if there is such an output port
142147
outValues.push({"_id": proc.ctrOuts.next });
143148
}

0 commit comments

Comments
 (0)