2016-10-06 112 views
1

我想在camunda執行BPMN圖的下方,與實施使用它在我的應用程序中集成節點JS簡單的例子,用的NodeJS

enter image description here

我閱讀和實現這個例子:

https://github.com/camunda/camunda-bpm-examples/tree/master/sdk-js/nodejs

,我可以連接到camunda發動機休息,並呼籲camunda API這樣的:

var CamSDK = require('camunda-bpm-sdk-js'); 

var camClient = new CamSDK.Client({ 
    mock: false, 
    // the following URL does not need authentication, 
    // but the tradeof is that some requests will fail 
    // e.g.: some filters use the reference to the user performing the request 
    apiUri: 'http://localhost:8080/engine-rest' 
}); 

var processDefinitionService = new camClient.resource('process-definition'); 
var processInstanceService = new camClient.resource('process-instance'); 
var filterService    = new camClient.resource('filter'); 
var deploymentService   = new camClient.resource('deployment'); 

,但我不知道如何實現一個簡單的項目,像上面BPMN和執行它,並與REST API的NodeJS應用程序中使用它,如果可能,我希望這種情況

回答

0

一個完整的樣本。如果你想使用的NodeJS要執行工作流程中的任務,您可以使用external task pattern。可以在https://github.com/nikku/camunda-worker-node上找到nodejs外部工作者的概念證明。但請節點這只是爲了演示目的,可能不適用於最新的Camunda版本。但這些概念應該仍然是一樣的。

camunda-bpm-sdk-js基本上是Camunda REST API的客戶端。有了它,您還可以查詢外部任務或用戶任務並完成它們。