碰到一个节点过不去,报空指针,但是参数都正常。

追踪了两天,没找到解决办法,大概知道原因。
传入的参数不知道为什么没有被二进制化存入act_ge_bytearray表,导致取不到人员。
重点在于其它任务正常通过。

留下国外大佬的理解。

Variables(serializable)
In engine layer, we can handle variables by using Java APIs like RuntimeService.setVariable/getVariable.If the parameter value over the argument of RuntimeService.setVariable matches the following conditions, the variable is stored in the database as binary(Table ACT_GE_BYTEARRAY Column BYTES_).

Condition
byte[]
https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/main/java/org/activiti/engine/impl/variable/ByteArrayType.java
A character string of 4000 or more characters
https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/main/java/org/activiti/engine/impl/variable/LongStringType.java
com.fasterxml.jackson.databind.JsonNode
https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/main/java/org/activiti/engine/impl/variable/LongJsonType.java
java.io.Serializable
https://github.com/Activiti/Activiti/blob/develop/activiti-engine/src/main/java/org/activiti/engine/impl/variable/SerializableType.java
Cause of this issue
When the API that acquires the variable is called, the following processing is performed in the internal processing of the Engine, and then the variable is returned to the caller.

If variable's type is serializable, engine get value by fetching Table ACT_GE_BYTEARRAY.
Engine deserialize value to each data type(byte[], String, JsonNode, Serializable).
In the APIs(RuntimeService.getVariableInstances/getVariableInstancesLocal) of this issue , the above processing is not executed inside the Engine. So, when the caller access value, the caller try to fetch binary value from ACT_GE_BYTEARRAY. But, since outside of Engine, NullPointerException occurs.

posted @ 2020-07-30 17:55  boxJLP  阅读(232)  评论(0)    收藏  举报