private boolean isOnSameActivity ( String lastActivityInstanceId , String lastActivityId , String currentActivityInstanceId , String currentActivityId ) { return //activityInstanceId's can be null on transitions, so the activityId must be equal ( ( lastActivityInstanceId == null && lastActivityInstanceId == currentActivityInstanceId && lastActivityId . equals ( currentActivityId ) ) //if activityInstanceId's are not null they must be equal -> otherwise execution changed || ( lastActivityInstanceId != null && lastActivityInstanceId . equals ( currentActivityInstanceId ) && ( lastActivityId == null || lastActivityId . equals ( currentActivityId ) ) ) ) ; }
Compares the given activity instance id s and activity id s to check if the execution is on the same activity as before an operation was executed . The activity instance id s can be null on transitions . In this case the activity Id s have to be equal otherwise the execution changed .