1

使用 camunda 提供的外部任务功能时,如果响应超过 4k 个字符,我将面临问题。我正在使用这个模块来实现外部任务功能

https://www.npmjs.com/package/camunda-external-task-client-js

例外:-

   NULL,
      3,
      NULL,
      NULL
    ) was aborted.  Call getNextException to see the cause.
org.postgresql.util.PSQLException: **ERROR: value too long for type character varying(4000)**
'. Flush summary:
 [
  INSERT HistoricVariableInstanceEntity[dd43fad7-904e-11ea-bb50-0242ac1f030a]
  INSERT HistoricJobLogEventEntity[dd4421ea-904e-11ea-bb50-0242ac1f030a]
  INSERT HistoricVariableUpdateEventEntity[dd3be481-904e-11ea-bb50-0242ac1f030a]
  INSERT HistoricVariableUpdateEventEntity[dd3c32a4-904e-11ea-bb50-0242ac1f030a]
  INSERT HistoricVariableUpdateEventEntity[dd43fad8-904e-11ea-bb50-0242ac1f030a]
  INSERT HistoricExternalTaskLogEntity[dd3ccee6-904e-11ea-bb50-0242ac1f030a]
  INSERT ByteArrayEntity[dd3c32a2-904e-11ea-bb50-0242ac1f030a]
  INSERT ByteArrayEntity[dd3c32a3-904e-11ea-bb50-0242ac1f030a]
  INSERT ByteArrayEntity[dd3ca7d5-904e-11ea-bb50-0242ac1f030a]
  INSERT VariableInstanceEntity[dd43fad7-904e-11ea-bb50-0242ac1f030a]
  INSERT MessageEntity[dd4421e9-904e-11ea-bb50-0242ac1f030a]
  DELETE ExternalTaskEntity[cadab10c-904e-11ea-bb50-0242ac1f030a]
  UPDATE VariableInstanceEntity[c82b4842-904e-11ea-bb50-0242ac1f030a]
  UPDATE VariableInstanceEntity[c82b4845-904e-11ea-bb50-0242ac1f030a]
  DELETE VariableInstanceEntity[cad273a0-904e-11ea-bb50-0242ac1f030a]
  DELETE VariableInstanceEntity[cad273a2-904e-11ea-bb50-0242ac1f030a]
  DELETE VariableInstanceEntity[cad273a4-904e-11ea-bb50-0242ac1f030a]
4

1 回答 1

1

这是由于 Camunda 变量限制为 4000 个字符。您在 Camunda 中的实例进程必须以任何格式提供响应,但不能以字符串的形式对其进行排序。几个建议:

  1. 将响应包装到一个对象(不是字符串)中。这样,它作为 blob 保存在数据库中。
  2. 使用 Camunda Spin 并将其处理为 JSON https://docs.camunda.org/manual/7.12/reference/spin/
于 2020-05-12T13:57:28.053 回答