我将此存储库 https://github.com/e2ebridge/bpmn 克隆到我的本地。 然后我尝试按照其README.md开始。 当我尝试构建REST服务器时,我发现它无法找到进程名称'TaskExampleProcess'
我的发展环境:
Windows 10
npm v3.3.12
node v5.1.0
问题再现如下:
server.js:
/**
* Copyright: E2E Technologies Ltd
*/
"use strict";
var bpmn = require('../lib/public.js');
var path = require('path');
var port = 9998;
var urlMap = {
"TaskExampleProcess": path.join(__dirname, "./resources/projects/simple/taskExampleProcess.bpmn")
};
// Returns a restify server.
var server = bpmn.createServer({urlMap: urlMap, logLevel: "debug"});
server.listen(port, function() {
console.log('%s listening at %s', server.name, server.url);
});
client.js:
var restify = require("restify");
// This example used the node-restify client
var client = restify.createJsonClient({url: "http://localhost:9998"});
client.post('/TaskExampleProcess', function (err, req, res, obj) {
console.log(err);
});
Step1:我运行server.js,它没有错误,控制台输出如下:
BPMNProcessServer listening at http://[::]:9998
Step2:然后我运行client.js,控制台输出如下:
{ [InvalidArgumentError: Could not find process name 'TaskExampleProcess'.]
message: 'Could not find process name \'TaskExampleProcess\'.',
statusCode: 409,
body:
{ code: 'InvalidArgument',
message: 'Could not find process name \'TaskExampleProcess\'.' },
restCode: 'InvalidArgument',
name: 'InvalidArgumentError' }
有没有人遇到过这个问题?原因是什么?怎么解决? 我期待着你的回复。谢谢。