Esempio n. 1
0
        protected internal virtual void CreateJobDefinitionOperationLogEntry(UserOperationLogContext opLogContext,
                                                                             long?previousPriority, JobDefinitionEntity jobDefinition)
        {
            PropertyChange propertyChange = new PropertyChange(JobDefinitionOverridingPriority, previousPriority,
                                                               jobDefinition.OverridingJobPriority);

            UserOperationLogContextEntry entry =
                UserOperationLogContextEntryBuilder.Entry(UserOperationLogEntryFields.OperationTypeSetPriority,
                                                          EntityTypes.JobDefinition).InContextOf(jobDefinition).PropertyChanges(propertyChange).Create();

            opLogContext.AddEntry(entry);
        }
Esempio n. 2
0
        protected internal virtual void CreateCascadeJobsOperationLogEntry(UserOperationLogContext opLogContext,
                                                                           JobDefinitionEntity jobDefinition)
        {
            // old value is unknown
            PropertyChange propertyChange = new PropertyChange(SetJobPriorityCmd.JobPriorityProperty, null,
                                                               jobDefinition.OverridingJobPriority);

            UserOperationLogContextEntry entry =
                UserOperationLogContextEntryBuilder.Entry(UserOperationLogEntryFields.OperationTypeSetPriority,
                                                          EntityTypes.Job).InContextOf(jobDefinition).PropertyChanges(propertyChange).Create();

            opLogContext.AddEntry(entry);
        }
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
//ORIGINAL LINE: @Override public object Execute(final org.Camunda.bpm.Engine.impl.interceptor.CommandContext commandContext)
            public object Execute(CommandContext commandContext)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.Camunda.bpm.Engine.impl.oplog.UserOperationLogContext userOperationLogContext = new org.Camunda.bpm.Engine.impl.oplog.UserOperationLogContext();
                UserOperationLogContext userOperationLogContext = new UserOperationLogContext();

                userOperationLogContext.UserId = "kermit";

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.Camunda.bpm.Engine.impl.oplog.UserOperationLogContextEntry entry = new org.Camunda.bpm.Engine.impl.oplog.UserOperationLogContextEntry("foo", "bar");
                UserOperationLogContextEntry entry = new UserOperationLogContextEntry("foo", "bar");

                //entry.PropertyChanges = (new PropertyChange(null, null, null));
                entry.TaskId = TASK_ID;
                userOperationLogContext.AddEntry(entry);

                commandContext.OperationLogManager.LogUserOperations(userOperationLogContext);
                return(null);
            }
        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;
        }