Error in evaluating expressions when run as unit test
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2016 08:57 AM
Hello!
I am facing strange issue, wherein when I have the flow condition configured as simple expression, then the unit testing works. However, when I configure flow condition as Simple or Advanced condition using flow variables, then it gives error as
org.activiti.engine.ActivitiException: Unknown property used in expression: ${(!(activiti_flowConditionsBean.isEmpty(execution, 'ProductId')) )and(activiti_flowConditionsBean.exists(execution, 'ProductId') && ProductId == 'ABC')}
Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'activiti_flowConditionsBean'
Unit tests are taken from https://github.com/Activiti/activiti-unit-test-template.git
Config :
No error case :
-<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${FieldValidationStatus == 'SUCCESS'}]]>
</conditionExpression>
Error case :
-<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${(!(activiti_flowConditionsBean.isEmpty(execution, 'ProductId')) )and(activiti_flowConditionsBean.exists(execution, 'ProductId') && ProductId == 'ABC')}]]>
</conditionExpression>
Please suggest the solution
I am facing strange issue, wherein when I have the flow condition configured as simple expression, then the unit testing works. However, when I configure flow condition as Simple or Advanced condition using flow variables, then it gives error as
org.activiti.engine.ActivitiException: Unknown property used in expression: ${(!(activiti_flowConditionsBean.isEmpty(execution, 'ProductId')) )and(activiti_flowConditionsBean.exists(execution, 'ProductId') && ProductId == 'ABC')}
Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'activiti_flowConditionsBean'
Unit tests are taken from https://github.com/Activiti/activiti-unit-test-template.git
Config :
No error case :
-<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${FieldValidationStatus == 'SUCCESS'}]]>
</conditionExpression>
Error case :
-<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${(!(activiti_flowConditionsBean.isEmpty(execution, 'ProductId')) )and(activiti_flowConditionsBean.exists(execution, 'ProductId') && ProductId == 'ABC')}]]>
</conditionExpression>
Please suggest the solution
Labels:
- Labels:
-
Archive
8 REPLIES 8
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2016 09:33 AM
Working:
-<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${FieldValidationStatus == 'SUCCESS'}]]>
</conditionExpression>
Error:
-<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${(!(activiti_flowConditionsBean.isEmpty(execution, 'ProductId')) )and(activiti_flowConditionsBean.exists(execution, 'ProductId') && ProductId == 'ABC')}]]>
</conditionExpression>
-<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${FieldValidationStatus == 'SUCCESS'}]]>
</conditionExpression>
Error:
-<conditionExpression xsi:type="tFormalExpression">
<![CDATA[${(!(activiti_flowConditionsBean.isEmpty(execution, 'ProductId')) )and(activiti_flowConditionsBean.exists(execution, 'ProductId') && ProductId == 'ABC')}]]>
</conditionExpression>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2016 03:25 AM
Hi Vicky,
Regards
Martin
activiti_flowConditionsBean
is missing. Add the bean to the configuration. It would be better to post a ling to the whole project with your failing jUnit test.Regards
Martin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2016 09:16 AM
Hi Martin,
Thanks for the reply.
Actually, I am not using any bean with name 'activiti_flowConditionsBean'. This is internally inserted by activiti when the condition is configured using 'Simple' or 'Advanced' tab.
Please see the images in the below links:
1) https://s11.postimg.io/5o6nnsg5f/No_Error.png If I configure condition as expression (as shown in image), it works from normal flow execution as well as unit test execution
2) https://s22.postimg.io/di9iaivy9/Error.png If I configure condition using Simple or Advanced tab (as shown in image), it works from normal flow execution, but fails from unit test execution (since it encounters activiti_flowConditionsBean missing error)
The normal flow is executed using ACTVITI-REST interface to start process instance.
The unit test is done using https://github.com/Activiti/activiti-unit-test-template.git
ProcessInstance processInstance = activitiRule.getRuntimeService().startProcessInstanceByKeyAndTenantId("XYZ",variables,"tenant_1");
Please suggest any possible solution. Also, let me know if anything else is required
Thanks for the reply.
Actually, I am not using any bean with name 'activiti_flowConditionsBean'. This is internally inserted by activiti when the condition is configured using 'Simple' or 'Advanced' tab.
Please see the images in the below links:
1) https://s11.postimg.io/5o6nnsg5f/No_Error.png If I configure condition as expression (as shown in image), it works from normal flow execution as well as unit test execution
2) https://s22.postimg.io/di9iaivy9/Error.png If I configure condition using Simple or Advanced tab (as shown in image), it works from normal flow execution, but fails from unit test execution (since it encounters activiti_flowConditionsBean missing error)
The normal flow is executed using ACTVITI-REST interface to start process instance.
The unit test is done using https://github.com/Activiti/activiti-unit-test-template.git
ProcessInstance processInstance = activitiRule.getRuntimeService().startProcessInstanceByKeyAndTenantId("XYZ",variables,"tenant_1");
Please suggest any possible solution. Also, let me know if anything else is required
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2016 09:23 AM
Hi Martin,
Thanks for the reply.
Actually, I am not using any bean with name 'activiti_flowConditionsBean'. This is internally inserted by activiti when the condition is configured using 'Simple' or 'Advanced' tab.
Please see the images in the below links:
1) https://s11.postimg.io/5o6nnsg5f/No_Error.png If I configure condition as expression (as shown in image), it works from normal flow execution as well as unit test execution
2) https://s22.postimg.io/di9iaivy9/Error.png If I configure condition using Simple or Advanced tab (as shown in image), it works from normal flow execution, but fails from unit test execution (since it encounters activiti_flowConditionsBean missing error)
The normal flow is executed using ACTVITI-REST interface to start process instance.
The unit test is done using https://github.com/Activiti/activiti-unit-test-template.git
ProcessInstance processInstance = activitiRule.getRuntimeService().startProcessInstanceByKeyAndTenantId("XYZ",variables,"tenant_1");
Please suggest any possible solution. Also, let me know if anything else is required
Thanks for the reply.
Actually, I am not using any bean with name 'activiti_flowConditionsBean'. This is internally inserted by activiti when the condition is configured using 'Simple' or 'Advanced' tab.
Please see the images in the below links:
1) https://s11.postimg.io/5o6nnsg5f/No_Error.png If I configure condition as expression (as shown in image), it works from normal flow execution as well as unit test execution
2) https://s22.postimg.io/di9iaivy9/Error.png If I configure condition using Simple or Advanced tab (as shown in image), it works from normal flow execution, but fails from unit test execution (since it encounters activiti_flowConditionsBean missing error)
The normal flow is executed using ACTVITI-REST interface to start process instance.
The unit test is done using https://github.com/Activiti/activiti-unit-test-template.git
ProcessInstance processInstance = activitiRule.getRuntimeService().startProcessInstanceByKeyAndTenantId("XYZ",variables,"tenant_1");
Please suggest any possible solution. Also, let me know if anything else is required
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2016 09:59 AM
Hi Martin,
Thanks for the reply.
Actually, I am not using any bean with name 'activiti_flowConditionsBean'. This is internally inserted by activiti when the condition is configured using 'Simple' or 'Advanced' tab.
Please see the images in the below links:
1) https://s11.postimg.io/5o6nnsg5f/No_Error.png If I configure condition as expression (as shown in image), it works from normal flow execution as well as unit test execution
2) https://s22.postimg.io/di9iaivy9/Error.png If I configure condition using Simple or Advanced tab (as shown in image), it works from normal flow execution, but fails from unit test execution (since it encounters activiti_flowConditionsBean missing error)
The normal flow is executed using ACTVITI-REST interface to start process instance.
The unit test is done using https://github.com/Activiti/activiti-unit-test-template.git
ProcessInstance processInstance = activitiRule.getRuntimeService().startProcessInstanceByKeyAndTenantId("XYZ",variables,"tenant_1");
Please suggest any possible solution. Also, let me know if anything else is required
Thanks for the reply.
Actually, I am not using any bean with name 'activiti_flowConditionsBean'. This is internally inserted by activiti when the condition is configured using 'Simple' or 'Advanced' tab.
Please see the images in the below links:
1) https://s11.postimg.io/5o6nnsg5f/No_Error.png If I configure condition as expression (as shown in image), it works from normal flow execution as well as unit test execution
2) https://s22.postimg.io/di9iaivy9/Error.png If I configure condition using Simple or Advanced tab (as shown in image), it works from normal flow execution, but fails from unit test execution (since it encounters activiti_flowConditionsBean missing error)
The normal flow is executed using ACTVITI-REST interface to start process instance.
The unit test is done using https://github.com/Activiti/activiti-unit-test-template.git
ProcessInstance processInstance = activitiRule.getRuntimeService().startProcessInstanceByKeyAndTenantId("XYZ",variables,"tenant_1");
Please suggest any possible solution. Also, let me know if anything else is required
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2016 03:38 PM
Can you post the link to your jUnit test?
Regards
Martin
Regards
Martin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-14-2016 09:19 AM
Hi Martin,
The source code is inside enterprise gitlab server, hence I cant share the exact link. However, I have attached all the files used in unit test.
As a reference, attaching images of activiti UI:
1) https://s11.postimg.io/5o6nnsg5f/No_Error.png If I configure condition as expression (as shown in image), it works from normal flow execution as well as unit test execution
2) https://s22.postimg.io/di9iaivy9/Error.png If I configure condition using Simple or Advanced tab (as shown in image), it works from normal flow execution, but fails from unit test execution (since it encounters activiti_flowConditionsBean missing error)
The source code is inside enterprise gitlab server, hence I cant share the exact link. However, I have attached all the files used in unit test.
As a reference, attaching images of activiti UI:
1) https://s11.postimg.io/5o6nnsg5f/No_Error.png If I configure condition as expression (as shown in image), it works from normal flow execution as well as unit test execution
2) https://s22.postimg.io/di9iaivy9/Error.png If I configure condition using Simple or Advanced tab (as shown in image), it works from normal flow execution, but fails from unit test execution (since it encounters activiti_flowConditionsBean missing error)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2016 09:22 AM
Hello,
Can any1 help please?
Can any1 help please?
