[KULRICE-11295] Unable to change rule action from Validation to Route to Peopleflow / Notify PeopleFlow Created: 25/Nov/13  Updated: 15/Jan/14  Resolved: 15/Dec/13

Status: Closed
Project: Kuali Rice Development
Component/s: Development
Affects Version/s: 2.3.2
Fix Version/s: 2.3.3, 2.4
Security Level: Public (Public: Anyone can view)

Type: Bug Fix Priority: Blocker
Reporter: Gayathri Athreya Assignee: Shannon Hess
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 1 day, 4 hours
Time Spent: Not Specified
Original Estimate: 1 day, 4 hours

Issue Links:
Fix
Similar issues:
KULRICE-6003Make PeopleFlow type service names friendlier to humans
KULRICE-6576PeopleFlow Action Id lookup throws NPE
KULRICE-13960Close/Clear Values/Search Buttons too far down on Agenda Editor PeopleFlow ID lookup screen
KULRICE-6277Apply Database changes for PeopleFlow Action Name
KULRICE-13312KRMS rule's action attributes not loaded for edit succesfully
KULRICE-8968PeopleFlow Maintenance Document - Unable to set ApprovePolicy when PeopleFlow Member is of type Group
KULRICE-14150STE on Peopleflow
KULRICE-6365On rule screen, PeopleFlow ID lookup for action types can pull in bogus parameters
KULRICE-13095PeopleFlow Routing Sequence on Reroute different from original route
KULRICE-13913Fill AFT Gap: KRMS Rules - Agenda Editor (add Actions of various types)
Rice Module:
KRMS
Application Requirement:
KC
Sprint: 2.4.0-m3 KRAD Sprint 4
KAI Review Status: Not Required
KTI Review Status: Not Required
Code Review Status: Not Required
Include in Release Notes?:
Yes

 Description   

Steps to reproduce on env2

Create an agenda made of one rule,
Add 1 proposition
Select validation action.
Update Rule
Blanket Approve

Search for Agenda
Edit Rule
Change Action to a different Action. Example, notify peopleflow
Update Rule
Blanket Approve
Open Document Search and see that the document is Enroute and eventually goes into Exception

This is the error in the logs

ATTR_DEFN_ID cannot be null.

The customRuleActionAttributesMap in the AgendaEditor needs to be refreshed when the peopleFlow action is changed. Otherwise, the AgendaEditor holds onto the old ruleActionAttributes for validation as well as the new ruleActionAttributes. If you go from notifuPeopleFlow to routeToPeopleFlow, this will not be a problem because the attributes for ruleAction in this case remain the same, which are peopleFlowId and peopleFlowName. whereas while going from validation to peopleFlow or vice versa, it changes from the validation message and the validation type (Error or warning) to the peopleFlow ones. One possible way to fix this would be to refresh this customRuleActionAttributesMap map when the action type id is changed.

To see what I mean, put a break point in the following code after agendaBO once you blanket approve and examine the agendaBO data.

AgendaEditorMaintainable.class
public void saveDataObject() {
        AgendaBo agendaBo = ((AgendaEditor) getDataObject()).getAgenda();

If you drill down all the way to AgendaBO>items>AgendaItemBO>RuleBO>Actions>ActionBO>attributeBOs
you will see that there are more attributes than the ones required for the agenda action. There should only be 2 attributeBOs each for validation action and routeToPeopleFlow/Notify PeopleFlow actions.



 Comments   
Comment by Peter Giles (Inactive) [ 09/Dec/13 ]

Note that this fix should go into the rice-2.3 branch.

Comment by Shannon Hess [ 15/Dec/13 ]

This issue has been fixed. While testing I also was getting the following error when changing the rule action from validation to the KRMSActionResolverType so I also fixed that issue as well.

java.lang.NullPointerException
at org.kuali.rice.kns.datadictionary.validation.AttributeValidatingTypeServiceBase.validateAttributes(AttributeValidatingTypeServiceBase.java:151)
at org.kuali.rice.krms.impl.type.KrmsTypeServiceBase.validateAttributes(KrmsTypeServiceBase.java:174)
at org.kuali.rice.krms.impl.type.KrmsTypeServiceBase.validateAttributesAgainstExisting(KrmsTypeServiceBase.java:183)
at org.kuali.rice.krms.impl.rule.AgendaEditorBusRule.validRuleActionAttributes(AgendaEditorBusRule.java:407)
at org.kuali.rice.krms.impl.rule.AgendaEditorBusRule.validateRuleAction(AgendaEditorBusRule.java:347)
at org.kuali.rice.krms.impl.rule.AgendaEditorBusRule.processAgendaItemBusinessRules(AgendaEditorBusRule.java:279)
at org.kuali.rice.krms.impl.ui.AgendaEditorController.editRule(AgendaEditorController.java:671)
at org.kuali.rice.krms.impl.ui.AgendaEditorController$$FastClassByCGLIB$$49b0d2b1.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631)
at org.kuali.rice.krms.impl.ui.AgendaEditorController$$EnhancerByCGLIB$$c7a4bc08.editRule(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Comment by Gayathri Athreya [ 15/Dec/13 ]

Awesome, thanks Shannon!

Comment by Gayathri Athreya [ 21/Dec/13 ]

Working now, thanks!!

Generated at Sun Jun 07 00:55:51 CDT 2020 using JIRA 6.1.5#6160-sha1:a61a0fc278117a0da0ec9b89167b8f29b6afdab2.