Some additional info. I did a remote debug and I've set a breakpoint on personService.getPerson(String, boolean), which results in the stacktrace below. It is clear that something activiti related triggers this method: AlfrescoScriptDelegate(ActivitiScriptBase).getPersonNode. So currently this is recreating a removed user. Is this the desired behaviour? Wouldn't it be better to call the getPerson() version that does not recreate the user?
Thread [pool-9-thread-1] (Suspended (entry into method getPerson in PersonServiceImpl))
PersonServiceImpl.getPerson(String, boolean) line: 421
PersonServiceImpl.getPerson(String) line: 412
GeneratedMethodAccessor684.invoke(Object, Object[]) line: not available
DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25
Method.invoke(Object, Object…) line: 597
AopUtils.invokeJoinpointUsingReflection(Object, Method, Object[]) line: 309
ReflectiveMethodInvocation.invokeJoinpoint() line: 183
ReflectiveMethodInvocation.proceed() line: 150
MethodSecurityInterceptor(MethodSecurityInterceptor).invoke(MethodInvocation) line: 80
ReflectiveMethodInvocation.proceed() line: 172
ExceptionTranslatorMethodInterceptor.invoke(MethodInvocation) line: 46
ReflectiveMethodInvocation.proceed() line: 172
AuditMethodInterceptor.invoke(MethodInvocation) line: 159
ReflectiveMethodInvocation.proceed() line: 172
TransactionInterceptor.invoke(MethodInvocation) line: 110
ReflectiveMethodInvocation.proceed() line: 172
JdkDynamicAopProxy.invoke(Object, Method, Object[]) line: 202
$Proxy89.getPerson(String) line: not available
AlfrescoScriptDelegate(ActivitiScriptBase).getPersonNode(String) line: 173
AlfrescoScriptDelegate(DelegateExecutionScriptBase).getInputMap(DelegateExecution, String) line: 98
AlfrescoScriptDelegate(DelegateExecutionScriptBase).runScript(DelegateExecution) line: 63
AlfrescoScriptDelegate.execute(DelegateExecution) line: 43
JavaDelegateInvocation.invoke() line: 34
JavaDelegateInvocation(DelegateInvocation).proceed() line: 37
DefaultDelegateInterceptor.handleInvocation(DelegateInvocation) line: 25
ServiceTaskJavaDelegateActivityBehavior.execute(DelegateExecution) line: 49
ServiceTaskJavaDelegateActivityBehavior.execute(ActivityExecution) line: 40
ClassDelegate.execute(ActivityExecution) line: 112
AtomicOperationActivityExecute.execute(InterpretableExecution) line: 40
CommandContext.performOperation(AtomicOperation, InterpretableExecution) line: 76
ExecutionEntity.performOperation(AtomicOperation) line: 481
AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(InterpretableExecution) line: 48
AtomicOperationTransitionNotifyListenerStart(AbstractEventAtomicOperation).execute(InterpretableExecution) line: 52
CommandContext.performOperation(AtomicOperation, InterpretableExecution) line: 76
ExecutionEntity.performOperation(AtomicOperation) line: 481
AtomicOperationTransitionNotifyListenerStart(AbstractEventAtomicOperation).execute(InterpretableExecution) line: 45
CommandContext.performOperation(AtomicOperation, InterpretableExecution) line: 76
ExecutionEntity.performOperation(AtomicOperation) line: 481
AtomicOperationTransitionCreateScope.execute(InterpretableExecution) line: 44
CommandContext.performOperation(AtomicOperation, InterpretableExecution) line: 76
ExecutionEntity.performOperation(AtomicOperation) line: 481
AtomicOperationTransitionNotifyListenerTake.execute(InterpretableExecution) line: 61
CommandContext.performOperation(AtomicOperation, InterpretableExecution) line: 76
ExecutionEntity.performOperation(AtomicOperation) line: 481
AtomicOperationTransitionDestroyScope.execute(InterpretableExecution) line: 111
CommandContext.performOperation(AtomicOperation, InterpretableExecution) line: 76
ExecutionEntity.performOperation(AtomicOperation) line: 481
AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(InterpretableExecution) line: 36
AtomicOperationTransitionNotifyListenerEnd(AbstractEventAtomicOperation).execute(InterpretableExecution) line: 52
CommandContext.performOperation(AtomicOperation, InterpretableExecution) line: 76
ExecutionEntity.performOperation(AtomicOperation) line: 481
AtomicOperationTransitionNotifyListenerEnd(AbstractEventAtomicOperation).execute(InterpretableExecution) line: 45
CommandContext.performOperation(AtomicOperation, InterpretableExecution) line: 76
ExecutionEntity.performOperation(AtomicOperation) line: 481
AtomicOperationTransitionDestroyScope.execute(InterpretableExecution) line: 109
CommandContext.performOperation(AtomicOperation, InterpretableExecution) line: 76
ExecutionEntity.performOperation(AtomicOperation) line: 481
AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(InterpretableExecution) line: 36
AtomicOperationTransitionNotifyListenerEnd(AbstractEventAtomicOperation).execute(InterpretableExecution) line: 52
CommandContext.performOperation(AtomicOperation, InterpretableExecution) line: 76
ExecutionEntity.performOperation(AtomicOperation) line: 481
ExecutionEntity.take(PvmTransition) line: 326
ExecutionEntity.takeAll(List<PvmTransition>, List<ActivityExecution>) line: 420
BoundaryEventActivityBehavior.execute(ActivityExecution) line: 57
TimerExecuteNestedActivityJobHandler.execute(String, ExecutionEntity, CommandContext) line: 48
AuthenticatedTimerJobHandler$1.doWork() line: 91
AuthenticatedTimerJobHandler$1.doWork() line: 87
AuthenticationUtil.runAs(RunAsWork<R>, String) line: 529
AuthenticatedTimerJobHandler.execute(String, ExecutionEntity, CommandContext) line: 86
TimerEntity(JobEntity).execute(CommandContext) line: 78
TimerEntity.execute(CommandContext) line: 62
ExecuteJobsCmd.execute(CommandContext) line: 61
CommandExecutorImpl.execute(Command<T>) line: 24
CommandContextInterceptor.execute(Command<T>) line: 42
SpringTransactionInterceptor$1.doInTransaction(TransactionStatus) line: 42
TransactionTemplate.execute(TransactionCallback<T>) line: 130
SpringTransactionInterceptor.execute(Command<T>) line: 40
LogInterceptor.execute(Command<T>) line: 33
ExecuteJobsRunnable.run() line: 36
ThreadPoolExecutor$Worker.runTask(Runnable) line: 886
ThreadPoolExecutor$Worker.run() line: 908
Thread.run() line: 662