【问题标题】:How to get current Workflow XML for active Instance by the Rest API如何通过 Rest API 获取活动实例的当前工作流 XML
【发布时间】:2018-05-20 02:01:49
【问题描述】:

在我的 AngularApp 中,我将使用 REST API 向用户展示当前的工作流程。 到目前为止没问题,usnig:

GET /process-definition/{id}/xml

bpmn.io 查看器。

但是可以高亮当前任务或获取工作流的特殊实例,高亮当前任务?

感谢您的帮助。

【问题讨论】:

    标签: bpmn camunda bpmn.io camunda-modeler


    【解决方案1】:

    1。得到实际的任务

    调用http://localhost:8080/engine-rest/task/?processInstanceId=<processInstanceId> 返回json with the taskDefinitionKey

    https://docs.camunda.org/manual/latest/reference/rest/task/get-query/

    2。为任务设置样式

    您可以添加样式类并突出显示任务。

    viewer.importXML(diagramXML, function() {
        var canvas = viewer.get('canvas');
        canvas.addMarker('<<TaskId>>', 'highlight');
    });
    

    颜色的 CSS:

    .highlight:not(.djs-connection) .djs-visual > :nth-child(1) {
        fill: green !important; /* color elements as green */
    }
    

    例子来自https://github.com/bpmn-io/bpmn-js-examples/tree/master/colors#adding-colors

    【讨论】:

    • 我认为它是“taskDefinitionKey”而不是“TaskId”对吧?
    • 赞成票 -1 反对票 接受 非常感谢您的支持,我的 CSS 还不能正常工作。该任务将突出显示,但不幸的是它没有着色。 也许你能再帮帮我。
    【解决方案2】:

    感谢您帮助我。要使其按照您的描述工作,您必须在 Angular.ts 文件中将 ViewEncapsulation 更改为 ViewEncapsulation.None。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-22
      • 2015-02-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多