Bonita BMP 7:将JSON数据绑定到表

时间:2018-11-23 17:26:28

标签: json bpm bonita

我是Bonita bpm的新手。我从连接器以json字符串形式接收数据。 就像连接器输出参数一样。我将此参数存储为池变量。 然后,我使用外部api获得此值:

../API/bpm/activityVariable/{{taskId}}/response_rows[enter image description here][1]

我得到了json数组,例如:

[{"reason":"reason","createdBy":"4","endDate":"2018-11-23T00:00:00+0000","persistenceId":"1","isApproved":"false","persistenceVersion":"0","startDate":"2018-11-15T00:00:00+0000","createtionDate":"2018-11-21T05:56:02+0000"},{"reason":"reason","createdBy":"4","endDate":"2018-11-23T00:00:00+0000","persistenceId":"2","isApproved":"false","persistenceVersion":"0","startDate":"2018-11-16T00:00:00+0000","createtionDate":"2018-11-21T06:01:26+0000"},{"reason":"test","createdBy":"4","endDate":"2018-11-16T00:00:00+0000","persistenceId":"3","isApproved":"false","persistenceVersion":"0","startDate":"2018-11-16T00:00:00+0000","createtionDate":"2018-11-21T07:26:57+0000"},{"reason":"reason","createdBy":"4","endDate":"2018-11-23T00:00:00+0000","persistenceId":"33","isApproved":"false","persistenceVersion":"0","startDate":"2018-11-22T00:00:00+0000","createtionDate":"2018-11-21T13:25:35+0000"},{"reason":"1111","createdBy":"4","endDate":"2018-11-17T00:00:00+0000","persistenceId":"34","isApproved":"false","persistenceVersion":"0","startDate":"2018-11-17T00:00:00+0000","createtionDate":"2018-11-21T13:26:58+0000"},{"reason":"rrr","createdBy":"4","endDate":"2018-11-30T00:00:00+0000","persistenceId":"35","isApproved":"false","persistenceVersion":"0","startDate":"2018-11-09T00:00:00+0000","createtionDate":"2018-11-21T13:29:37+0000"}]

我可以从此json创建json变量并将其设置为数据源。 我看到一切正常。但是,当我将数据设置为外部API变量时,表中什么也没有显示。

我使用变量的表达式而不是常量(内容设置中的一个小按钮)。

如何将json数组显示为表格?可行吗?

1 个答案:

答案 0 :(得分:0)

您可以将API URL另存为字符串变量

    return '../API/bpm/activityVariable/' + $data.taskId + '/response_rows[enter image description here][1]';

并将其用作URL表达式或变量。