Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-7643

DTOConverter#convertWorkflowAttributeDefinition only looks for a definition by name now

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.1.1
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      In Rice 1.x, DTOConverter would attempt to lookup a workflow attribute definition first by class name and then by attribute name. In Rice 2.x, it only looks up by attribute name. This breaks attribute lookups, especially while running in remote applications.

      Example:
      Rice 1.x

      
      
              // get the rule attribute so we can get's it's message antity and not blow up if it's remote
              RuleAttribute ruleAttribute = KEWServiceLocator.getRuleAttributeService().findByClassName(definitionVO.getAttributeName());
              if (ruleAttribute == null) {
                  ruleAttribute = KEWServiceLocator.getRuleAttributeService().findByName(definitionVO.getAttributeName());
              }
              if (ruleAttribute == null) {
                  throw new WorkflowRuntimeException("Attribute " + definitionVO.getAttributeName() + " not found");
              }
      

      Rice 2.x

      ExtensionDefinition extensionDefinition = KewApiServiceLocator.getExtensionRepositoryService().getExtensionByName(definition.getAttributeName());
              if (extensionDefinition == null) {
                  throw new WorkflowRuntimeException("Extension " + definition.getAttributeName() + " not found");
              }
      

        Attachments

          Issue Links

            Activity

            Hide
            grpatter Greg Patterson (Inactive) added a comment -

            Discovered by IU upgrade issue: https://uisapp2.iu.edu/jira-prd//browse/EN-2685

            Show
            grpatter Greg Patterson (Inactive) added a comment - Discovered by IU upgrade issue: https://uisapp2.iu.edu/jira-prd//browse/EN-2685
            Hide
            grpatter Greg Patterson (Inactive) added a comment -

            Fix committed

            Show
            grpatter Greg Patterson (Inactive) added a comment - Fix committed
            Hide
            gathreya Gayathri Athreya added a comment - - edited

            I just brought in Rice 2.1.1-rc1 and this causes an issue when I try to save a Proposal Development Document. This is the stack trace I see.
            2012-07-11 11:31:40,190 [qtp17027752-95] u:quickstart/d:4111 FATAL org.kuali.rice.core.framework.persistence.jta.KualiTransactionInterceptor - Exception caught by Transaction Interceptor, this will cause a rollback at the end of the transaction.
            java.lang.NullPointerException
            at org.kuali.rice.kew.dto.DTOConverter.convertWorkflowAttributeDefinition(DTOConverter.java:237)
            at org.kuali.rice.kew.dto.DTOConverter.createDocumentContentSection(DTOConverter.java:160)
            at org.kuali.rice.kew.dto.DTOConverter.buildUpdatedDocumentContent(DTOConverter.java:103)
            at org.kuali.rice.kew.impl.action.WorkflowDocumentActionsServiceImpl.init(WorkflowDocumentActionsServiceImpl.java:235)
            at org.kuali.rice.kew.impl.action.WorkflowDocumentActionsServiceImpl.executeActionInternal(WorkflowDocumentActionsServiceImpl.java:1345)
            at org.kuali.rice.kew.impl.action.WorkflowDocumentActionsServiceImpl.saveDocumentData(WorkflowDocumentActionsServiceImpl.java:702)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
            at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)

            When I inspected the DTOConverter class, I noticed that at line 237, KEWServiceLocator.getRuleAttributeService() is returning null in an embedded environment.

            Show
            gathreya Gayathri Athreya added a comment - - edited I just brought in Rice 2.1.1-rc1 and this causes an issue when I try to save a Proposal Development Document. This is the stack trace I see. 2012-07-11 11:31:40,190 [qtp17027752-95] u:quickstart/d:4111 FATAL org.kuali.rice.core.framework.persistence.jta.KualiTransactionInterceptor - Exception caught by Transaction Interceptor, this will cause a rollback at the end of the transaction. java.lang.NullPointerException at org.kuali.rice.kew.dto.DTOConverter.convertWorkflowAttributeDefinition(DTOConverter.java:237) at org.kuali.rice.kew.dto.DTOConverter.createDocumentContentSection(DTOConverter.java:160) at org.kuali.rice.kew.dto.DTOConverter.buildUpdatedDocumentContent(DTOConverter.java:103) at org.kuali.rice.kew.impl.action.WorkflowDocumentActionsServiceImpl.init(WorkflowDocumentActionsServiceImpl.java:235) at org.kuali.rice.kew.impl.action.WorkflowDocumentActionsServiceImpl.executeActionInternal(WorkflowDocumentActionsServiceImpl.java:1345) at org.kuali.rice.kew.impl.action.WorkflowDocumentActionsServiceImpl.saveDocumentData(WorkflowDocumentActionsServiceImpl.java:702) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) When I inspected the DTOConverter class, I noticed that at line 237, KEWServiceLocator.getRuleAttributeService() is returning null in an embedded environment.
            Hide
            grpatter Greg Patterson (Inactive) added a comment -

            That seems odd that the ruleAttributeService is null as it's in _KewEmbeddedRuleServicesSpringBeans.xml so I would think it should be getting loaded in KFS

              <!--  RuleAttributeService -->
              <bean id="enRuleAttributeService" class="org.kuali.rice.kew.rule.service.impl.RuleAttributeServiceImpl"
                    lazy-init="true">
                <property name="ruleAttributeDAO">
                  <ref bean="enRuleAttributeDAO"/>
                </property>
              </bean>
            
            Show
            grpatter Greg Patterson (Inactive) added a comment - That seems odd that the ruleAttributeService is null as it's in _KewEmbeddedRuleServicesSpringBeans.xml so I would think it should be getting loaded in KFS <!-- RuleAttributeService --> <bean id= "enRuleAttributeService" class= "org.kuali.rice.kew.rule.service.impl.RuleAttributeServiceImpl" lazy-init= " true " > <property name= "ruleAttributeDAO" > <ref bean= "enRuleAttributeDAO" /> </property> </bean>
            Hide
            gilesp Peter Giles (Inactive) added a comment -

            It's is in KC embedded where they are seeing the issue. I'm wondering if the RuleAttributeService bean should be moved to the KEW embedded spring config.

            Show
            gilesp Peter Giles (Inactive) added a comment - It's is in KC embedded where they are seeing the issue. I'm wondering if the RuleAttributeService bean should be moved to the KEW embedded spring config.
            Hide
            gilesp Peter Giles (Inactive) added a comment -

            Sweet, Gayathri reported that its working for KC after moving that bean to the embedded config.

            Show
            gilesp Peter Giles (Inactive) added a comment - Sweet, Gayathri reported that its working for KC after moving that bean to the embedded config.
            Hide
            jcoltrin Jessica Coltrin (Inactive) added a comment -

            release notes are generated. closing issues.

            Show
            jcoltrin Jessica Coltrin (Inactive) added a comment - release notes are generated. closing issues.

              People

              • Assignee:
                gilesp Peter Giles (Inactive)
                Reporter:
                grpatter Greg Patterson (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: