New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing processDefinitionKey in resumed process instances in query service #2318

Closed
miguelruizdev opened this Issue Dec 27, 2018 · 5 comments

Comments

3 participants
@miguelruizdev
Copy link
Contributor

miguelruizdev commented Dec 27, 2018

The processDefinitionKey disappears in query service after resuming a process instance previously suspended.
When suspended, the instance still keeps the field:
image
When resumed, the field is gone:
image

@miguelruizdev miguelruizdev added this to the Beta5 milestone Dec 27, 2018

@miguelruizdev miguelruizdev added this to Open in Activiti 7.x via automation Dec 27, 2018

@miguelruizdev miguelruizdev self-assigned this Dec 27, 2018

@salaboy salaboy modified the milestones: Beta5, RC1 Dec 27, 2018

@salaboy salaboy assigned CTI777 and unassigned miguelruizdev Jan 2, 2019

@salaboy salaboy modified the milestones: RC1, Beta5 Jan 2, 2019

@CTI777

This comment has been minimized.

Copy link
Contributor

CTI777 commented Jan 3, 2019

Currently it seems that all events related to process, except of create an start should have processDefinitionKey = null
In this class org.activiti.engine.impl.cmd.AbstractSetProcessInstanceStateCmd Execute method is called, and it returns object where everything is null
ExecutionEntity executionEntity = commandContext.getExecutionEntityManager().findById(processInstanceId);

This can be used for tests...
public class ExecutionEventsTest extends PluggableActivitiTestCase

At the low end a following function is called, and returned object has important values null:
public T selectOne(String statement, Object parameter)
from the class
public class DefaultSqlSession implements SqlSession

To say the truth I do not know what to do to get this value for event: low level functions do not pick up these values. Maybe we have to make changes in configuration of queries. We have to really discuss this once...
@salaboy @miguelruizdev

@miguelruizdev

This comment has been minimized.

Copy link
Contributor

miguelruizdev commented Jan 3, 2019

As green tests by @CTI777 suggest, it turns out that the missing information in the entity, is present in the event:

  • In AuditProducerIT, this passes:
    assertThat(((CloudProcessResumedEvent)receivedEvents.get(0)).getProcessDefinitionKey()).isEqualTo(SIMPLE_PROCESS);
  • Whereas this doesn't:
    assertThat(((CloudProcessResumedEvent)receivedEvents.get(0)).getEntity().getProcessDefinitionKey()).isEqualTo(SIMPLE_PROCESS);
@miguelruizdev

This comment has been minimized.

Copy link
Contributor

miguelruizdev commented Jan 3, 2019

We wonder if this has a fix at a converter level, and where that converter might be

@salaboy

This comment has been minimized.

Copy link
Member

salaboy commented Jan 3, 2019

Just to be sure.. the problem is here:
https://github.com/Activiti/activiti-cloud-query-service/blob/develop/activiti-cloud-services-query/activiti-cloud-services-query-rest/src/main/java/org/activiti/cloud/services/query/events/handlers/ProcessResumedEventHandler.java#L50

When resuming a process we shouldn't override this data if the entity already has it stored from previous events. Also it highlights the problem of looking into the "event"."entity" to get that information and sometimes.. depending on the event that information is not available on the "entity" level.. This means that we should upgrade and unify our handlers to make sure that we consume the information from the top "event" level.

@salaboy

This comment has been minimized.

Copy link
Member

salaboy commented Jan 4, 2019

PRs merged.. so closing this issues..

@salaboy salaboy closed this Jan 4, 2019

Activiti 7.x automation moved this from Open to Closed Jan 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment