PUBLIC - Liferay Portal Community Edition
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-20059

KaleoInstanceLocalServiceImpl.updateKaleoInstance(long, Map, ServiceContext) does not persist KaleoInstance when changing workflow context

    Details

    • Branch Version/s:
      6.1.x, 6.0.x
    • Backported to Branch:
      Committed
    • Epic/Theme:
    • Fix Priority:
      4
    • Similar Issues:
      Show 5 results 

      Description

      When changing the workflow context of a workflow instance by calling WorkflowInstanceManagerUtil.updateWorkflowContext() (forwarding to Kaleo implementation of WorkflowInstanceManager), the workflow context is changed in the workflow instance returned by the method, but the change is not committed to the database.

      KaleoInstanceLocalServiceImpl.updateKaleoInstance() should call KaleoInstancePersistence.update() after changing the workflow context.

      Untested correction is the following (note kaleoInstancePersistence.update()):

      KaleoInstanceLocalServiceImpl.java
      public KaleoInstance updateKaleoInstance(
      		long kaleoInstanceId, Map<String, Serializable> workflowContext,
      		ServiceContext serviceContext)
      	throws PortalException, SystemException {
      
      	KaleoInstance kaleoInstance = kaleoInstancePersistence.findByPrimaryKey(
      		kaleoInstanceId);
      
      	kaleoInstance.setWorkflowContext(
      		WorkflowContextUtil.convert(workflowContext));
      
      	kaleoInstancePersistence.update(kaleoInstance, false);
      
      	return kaleoInstance;
      }
      

      The JBPM implementation correctly calls jbpmContext.save(token) in WorkflowInstanceManagerImpl.updateWorkflowContext().

        Activity

        Hide
        Soeren Unruh added a comment -

        Patch against trunk revision 87119 fixing issue.

        Show
        Soeren Unruh added a comment - Patch against trunk revision 87119 fixing issue.
        Hide
        Ryan Wan added a comment -

        Hi Soeren,

        Thank you for reporting this issue. I have verified this in trunk and 6.0. I will now update the ticket.

        Show
        Ryan Wan added a comment - Hi Soeren, Thank you for reporting this issue. I have verified this in trunk and 6.0. I will now update the ticket.
        Hide
        Michael Saechang added a comment -

        Committed on:
        Plugins 6.2.x GIT ID: 3bb45dfb8ad837aa2e0c8e157d8c02dc8e4e07b0.

        Show
        Michael Saechang added a comment - Committed on: Plugins 6.2.x GIT ID: 3bb45dfb8ad837aa2e0c8e157d8c02dc8e4e07b0.
        Hide
        Michael Saechang added a comment -

        Cannot be tested by QA as per Mike Han. Closing as 'Fixed' because code has been committed.

        Unit tests will be added.

        Show
        Michael Saechang added a comment - Cannot be tested by QA as per Mike Han. Closing as 'Fixed' because code has been committed. Unit tests will be added.

          People

          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              2 years, 16 weeks, 2 days ago

              Development

                Structure Helper Panel