I start a bpm,but in ACT_RU_EXECUTION insert two data

hi cuba :
i have two process,
process’s name is “clientA” and “sampleprocess”,
“clientA” have a serviceTask to start “sampleprocess”,
but i found it creat two data in table of ACT_RU_EXECUTION about “clientA”,
%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20180726172418
in picture:
id “35035” and “35066” is “clientA”,
but in table of BPM_PROC_INSTANCE used id “35035”
%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20180726173729

i need throwing a signal in “sampleprocess” ,and “clientA” catching the signal ,
so i use
RuntimeService.signalEventReceived(String signalName, String executionId);
i get the executionId from BPM_PROC_INSTANCE 's ACT_PROCESS_INSTANCE_ID ,
but the ACT_PROCESS_INSTANCE_ID is “35035”,
%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20180726174017
in ACT_RU_EVENT_SUBSCR table executionId is “35066” , so i can’t be right throwing the signal

If question is about how to get right executionId: there is ActivitiRunetimeService.createExecutionQuery() to get it:

            org.activiti.engine.runtime.Execution execution = activitiRunetimeService.createExecutionQuery()
					.processInstanceId(procInstance.getActProcessInstanceId())
					.signalEventSubscriptionName(signalName)
					.singleResult();
			if (execution != null)
				activitiRunetimeService.signalEventReceived(signalName, execution.getId());
1 Like

thanks
it’s suer, but Why does it have two pieces of data
%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20180727084150

I could be wrong but i believe first one (35035) it is your serviceTask - second (35066) SignalCatcher.
So 35035 isn’t active since it is already executed.

the execution_id is “35066” but the proc_inst_id is “35035”
so i can use proc_inst_id and (event_name or activity_id) to query the execution_id ,but it’s unfriendly ,
as you say, I personally think that procInstance.getActProcessInstanceId() will return execution_id ,but it’s not