Skip to content

Commit d1e2f25

Browse files
committed
Add wfId and wfName to hflowRun callback
1 parent 6c09534 commit d1e2f25

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

bin/hflow.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ if (opts.run) {
3333
if (opts['--with-server']) {
3434
hflowStartServer();
3535
}
36-
hflowRun(opts, function(err, engine) { });
36+
hflowRun(opts, function(err, engine, wfId, wfName) { });
3737
} else if (opts.send) {
3838
hflowSend(opts);
3939
} else if (opts['start-server']) {
4040
hflowStartServer();
4141
} else if (opts.recover) {
42-
hflowRun(opts, function(err, engine) { });
42+
hflowRun(opts, function(err, engine, wfId, wfName) { });
4343
} /*else if (opts.submit) {
4444
hflowSubmit(opts);
4545
}*/

common/wfRun.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ function hflowStartServer() {
9696
** '<persistence-log>': (string/null) -- name/path to the recovery file (must be set if 'recover' is true)
9797
** '<plugin_module_name>': (array of strings) -- array of plugin modules to be loaded
9898
**
99-
** Returns runCb(engine):
99+
** Returns runCb(engine, wfId, wfName):
100100
** - engine: Engine object that represents the execution of the worklfow
101+
** - wfId: unique workflow identifier
102+
** - wfName: workflow name (from workflow.json)
101103
*/
102104
function hflowRun(opts, runCb) {
103105
var dbId = 0,
@@ -255,7 +257,7 @@ function hflowRun(opts, runCb) {
255257
createWf(function (err, wfId, wfName) {
256258
runWf(wfId, wfName, function(engine) {
257259
if (runCb) {
258-
runCb(null, engine);
260+
runCb(null, engine, wfId, wfName);
259261
}
260262
});
261263
});

0 commit comments

Comments
 (0)