예제 #1
0
 public override string ToString() =>
 ProcessInstanceId.ToString() + " " +
 (Name ?? "").PadRight(20).Substring(0, 20) + " " +
 (Version ?? "0.0.0.0").PadRight(10).Substring(0, 10) + " " +
 StartTime.ToString() + " -> " + EndTime.ToString() + " = " +
 ExitCode.ToString("D3") + " " +
 (FileName ?? "");
예제 #2
0
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hash = ProcessTaskId.GetHashCode();
         // Suitable nullity checks etc, of course :)
         if (ProcessTaskName != null)
         {
             hash = hash * 17 + ProcessTaskName.GetHashCode();
         }
         if (ProcessTaskOwner != null)
         {
             hash = hash * 17 + ProcessTaskOwner.GetHashCode();
         }
         if (ParentTaskId != null)
         {
             hash = hash * 17 + ParentTaskId.GetHashCode();
         }
         hash = hash * 17 + Priority.GetHashCode();
         if (ProcessKey != null)
         {
             hash = hash * 17 + ProcessKey.GetHashCode();
         }
         if (ProcessInstanceId != null)
         {
             hash = hash * 17 + ProcessInstanceId.GetHashCode();
         }
         if (ProcessItemDefinitionId != null)
         {
             hash = hash * 17 + ProcessItemDefinitionId.GetHashCode();
         }
         hash = hash * 17 + SuspensionState.GetHashCode();
         return(hash);
     }
 }
예제 #3
0
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hash = ProcessInstanceId.GetHashCode();
         // Suitable nullity checks etc, of course :)
         if (ProcessKey != null)
         {
             hash = hash * 17 + ProcessKey.GetHashCode();
         }
         if (ProcessInstanceName != null)
         {
             hash = hash * 17 + ProcessInstanceName.GetHashCode();
         }
         if (BusinessKey != null)
         {
             hash = hash * 17 + BusinessKey.GetHashCode();
         }
         hash = hash * 17 + SuspensionState.GetHashCode();
         if (UserCandidates != null)
         {
             hash = hash * 17 + UserCandidates.GetHashCode();
         }
         if (Owner != null)
         {
             hash = hash * 17 + Owner.GetHashCode();
         }
         return(hash);
     }
 }
예제 #4
0
        public override int GetHashCode()
        {
            int prime  = 31;
            int result = 1;

            result = prime * result + ((Name == null) ? 0 : Name.GetHashCode());
            result = prime * result + ((ProcessInstanceId == null) ? 0 : ProcessInstanceId.GetHashCode());
            return(result);
        }
        public virtual void testBatchExecutionFailureWithMissingProcessInstance()
        {
            var deployment        = testRule.Deploy(instance);
            var processDefinition = deployment.DeployedProcessDefinitions[0];
            var batch             = helper.StartAfterAsync("process1", 2, "user1", processDefinition.Id);

            helper.ExecuteSeedJob(batch);

            var processInstances = runtimeService.CreateProcessInstanceQuery()

                                   .ToList();
            var deletedProcessInstanceId = processInstances[0].Id;

            // when
            runtimeService.DeleteProcessInstance(deletedProcessInstanceId, "test");
            helper.ExecuteJobs(batch);

            // then the remaining process instance was modified
            foreach (var ProcessInstanceId in helper.CurrentProcessInstances)
            {
                if (ProcessInstanceId.Equals(helper.CurrentProcessInstances[0]))
                {
                    var u = runtimeService.GetActivityInstance(ProcessInstanceId);
                    Assert.IsNull(u);
                    continue;
                }

                var updatedTree = runtimeService.GetActivityInstance(ProcessInstanceId);
                Assert.NotNull(updatedTree);
                Assert.AreEqual(ProcessInstanceId, updatedTree.ProcessInstanceId);

                ActivityInstanceAssert.That(updatedTree)
                .HasStructure(ActivityInstanceAssert.DescribeActivityInstanceTree(processDefinition.Id)
                              .Activity("user1")
                              .Activity("user2")
                              .Done());
            }

            // and one batch job failed and has 2 retries left
            var modificationJobs = helper.GetExecutionJobs(batch);

            Assert.AreEqual(1, modificationJobs.Count);

            var failedJob = modificationJobs[0];

            Assert.AreEqual(2, failedJob.Retries);
            Assert.That(failedJob.ExceptionMessage, Does.Contain("ENGINE-13036"));
            Assert.That(failedJob.ExceptionMessage,
                        Does.Contain("Process instance '" + deletedProcessInstanceId + "' cannot be modified"));
        }
예제 #6
0
        public override Boolean Equals(Object obj)
        {
            if (obj == this)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (!(obj is ProcessInstanceVarPk))
            {
                return(false);
            }
            ProcessInstanceVarPk other = (ProcessInstanceVarPk)obj;

            if (Name == null)
            {
                if (other.Name != null)
                {
                    return(false);
                }
            }
            else if (!Name.Equals(other.Name))
            {
                return(false);
            }
            if (ProcessInstanceId == null)
            {
                if (other.ProcessInstanceId != null)
                {
                    return(false);
                }
            }
            else if (!ProcessInstanceId.Equals(other.ProcessInstanceId))
            {
                return(false);
            }
            return(true);
        }
예제 #7
0
        public bool Equals(ProcessTask other)
        {
            // Check for null
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            // Check for same reference
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            // Not Check ProcessTaskId, because generated Guid

            // Check for same value

            return(((ProcessTaskName == null && other.ProcessTaskName == null) || (ProcessTaskName != null && other.ProcessTaskName != null && ProcessTaskName.Equals(other.ProcessTaskName))) &&
                   ((ProcessTaskOwner == null && other.ProcessTaskOwner == null) || (ProcessTaskOwner != null && other.ProcessTaskOwner != null && ProcessTaskOwner.Equals(other.ProcessTaskOwner))) &&
                   ((ParentTaskId == null && other.ParentTaskId == null) || (ParentTaskId != null && other.ParentTaskId != null && ParentTaskId.Equals(other.ParentTaskId))) &&
                   ((ProcessKey == null && other.ProcessKey == null) || (ProcessKey != null && other.ProcessKey != null && ProcessKey.Equals(other.ProcessKey))) &&
                   ((ProcessInstanceId == null && other.ProcessInstanceId == null) || (ProcessInstanceId != null && other.ProcessInstanceId != null && ProcessInstanceId.Equals(other.ProcessInstanceId))) &&
                   ((ProcessItemDefinitionId == null && other.ProcessItemDefinitionId == null) || (ProcessItemDefinitionId != null && other.ProcessItemDefinitionId != null && ProcessItemDefinitionId.Equals(other.ProcessItemDefinitionId))) &&
                   SuspensionState.Equals(other.SuspensionState));
        }