@@ -276,6 +276,34 @@ public void testInvokeIntegerMethodWithNullParameter() {
276276 assertThat (value ).isNull ();
277277 }
278278
279+ @ Test
280+ @ Deployment (resources = "org/flowable/engine/test/api/runtime/oneTaskProcess.bpmn20.xml" )
281+ public void testResolveRecordProperties () {
282+ ProcessInstance processInstance = runtimeService .startProcessInstanceByKey ("oneTaskProcess" );
283+
284+ Object value = managementService .executeCommand (commandContext -> {
285+ Expression expression = processEngineConfiguration .getExpressionManager ().createExpression ("#{bean.name}" );
286+ ExecutionEntity executionEntity = (ExecutionEntity ) runtimeService .createProcessInstanceQuery ()
287+ .processInstanceId (processInstance .getId ())
288+ .includeProcessVariables ().singleResult ();
289+ executionEntity .setTransientVariable ("bean" , new TestRecord ("kermit" , 30 ));
290+ return expression .getValue (executionEntity );
291+ });
292+
293+ assertThat (value ).isEqualTo ("kermit" );
294+
295+ value = managementService .executeCommand (commandContext -> {
296+ Expression expression = processEngineConfiguration .getExpressionManager ().createExpression ("#{bean.age}" );
297+ ExecutionEntity executionEntity = (ExecutionEntity ) runtimeService .createProcessInstanceQuery ()
298+ .processInstanceId (processInstance .getId ())
299+ .includeProcessVariables ().singleResult ();
300+ executionEntity .setTransientVariable ("bean" , new TestRecord ("kermit" , 30 ));
301+ return expression .getValue (executionEntity );
302+ });
303+
304+ assertThat (value ).isEqualTo (30 );
305+ }
306+
279307 @ Test
280308 @ Deployment (resources = "org/flowable/engine/test/api/runtime/oneTaskProcess.bpmn20.xml" )
281309 public void testInvokeOnArrayNode () {
@@ -398,4 +426,7 @@ public String nonPrimitiveInteger(Integer value) {
398426 return value == null ? null : value .toString ();
399427 }
400428 }
429+
430+ record TestRecord (String name , int age ) {
431+ }
401432}
0 commit comments