问题
An expression with conditions does not work when testing a bpm process created in bpm-explorer alfresco activiti.
${document.attributes['EPR/DMS/DMBTR'] < 10000000
&& document.attributes['EPR/DMS/DMBTR'] >= 5000000
&& document.attributes['EPR/DMS/CONCERN_FLG'] == true}
|| ${document.attributes['EPR/DMS/DMBTR'] >= 10000000}
such options do not work either
${(document.attributes['EPR/DMS/DMBTR'] < 10000000
&& document.attributes['EPR/DMS/DMBTR'] >= 5000000
&& document.attributes['EPR/DMS/CONCERN_FLG'] == true)
|| document.attributes['EPR/DMS/DMBTR'] >= 10000000}
Displays error
Error parsing '${document.attributes['EPR/DMS/DMBTR'] < 10000000 \n&& \n(document.attributes['EPR/DMS/DMBTR'] > 5000000 || document.attributes['EPR/DMS/DMBTR'] = 5000000) \n&& document.attributes['EPR/DMS/CONCERN_FLG'] == true} \n|| ${document.attributes['EPR/DMS/DMBTR'] > 10000000 || document.attributes['EPR/DMS/DMBTR'] =10000000}': lexical error at position 143, encountered invalid character '=', expected expression token
回答1:
Try using >
and <
instead of the >
and <
. This will encode the string correctly and hope it will help solve the issue.
回答2:
Try this,
execution.setVariable('EPR_DMS_DMBTR', document.attributes['EPR/DMS/DMBTR'])
execution.setVariable('EPR_DMS_CONCERN_FLG', document.attributes['EPR/DMS/CONCERN_FLG'])
${EPR_DMS_DMBTR < 10000000
&& EPR_DMS_CONCERN_FLG >= 5000000
&& EPR_DMS_DMBTR == true)
|| EPR_DMS_DMBTR >= 10000000}
来源:https://stackoverflow.com/questions/57923324/complex-expressions-dont-execute-in-alfresco-activiti-web-version