protected internal virtual void InitUserOperationLogEvent(UserOperationLogEntryEventEntity evt, UserOperationLogContext context, UserOperationLogContextEntry contextEntry, PropertyChange propertyChange)
        {
            // init properties
            evt.DeploymentId         = contextEntry.DeploymentId;
            evt.EntityType           = contextEntry.EntityType;
            evt.OperationType        = contextEntry.OperationType;
            evt.OperationId          = context.OperationId;
            evt.UserId               = context.UserId;
            evt.ProcessDefinitionId  = contextEntry.ProcessDefinitionId;
            evt.ProcessDefinitionKey = contextEntry.ProcessDefinitionKey;
            evt.ProcessInstanceId    = contextEntry.ProcessInstanceId;
            evt.ExecutionId          = contextEntry.ExecutionId;
            evt.CaseDefinitionId     = contextEntry.CaseDefinitionId;
            evt.CaseInstanceId       = contextEntry.CaseInstanceId;
            evt.CaseExecutionId      = contextEntry.CaseExecutionId;
            evt.TaskId               = contextEntry.TaskId;
            evt.JobId           = contextEntry.JobId;
            evt.JobDefinitionId = contextEntry.JobDefinitionId;
            evt.BatchId         = contextEntry.BatchId;
            evt.Timestamp       = ClockUtil.CurrentTime;

            // init property value
            evt.Property = propertyChange.PropertyName;
            evt.OrgValue = propertyChange.OrgValueString;
            evt.NewValue = propertyChange.NewValueString;
        }
        // User Operation Logs ///////////////////////////

        public virtual IList <HistoryEvent> CreateUserOperationLogEvents(UserOperationLogContext context)
        {
            IList <HistoryEvent> historyEvents = new List <HistoryEvent>();

            string operationId = Context.ProcessEngineConfiguration.IdGenerator.NewGuid();//.NextId;

            context.OperationId = operationId;

            foreach (UserOperationLogContextEntry entry in context.Entries)
            {
                foreach (PropertyChange propertyChange in entry.PropertyChanges)
                {
                    UserOperationLogEntryEventEntity evt = new UserOperationLogEntryEventEntity();

                    InitUserOperationLogEvent(evt, context, entry, propertyChange);

                    historyEvents.Add(evt);
                }
            }

            return(historyEvents);
        }