public override object Clone()
 {
     return(new ProcessInstanceAggregate
     {
         AggregateId = AggregateId,
         ProcessFileId = ProcessFileId,
         ProcessFileName = ProcessFileName,
         Version = Version,
         CreateDateTime = CreateDateTime,
         UpdateDateTime = UpdateDateTime,
         Status = Status,
         SequenceFlows = SequenceFlows.Select(_ => (SequenceFlow)_.Clone()).ToList(),
         SerializedElementDefs = SerializedElementDefs.Select(_ => (SerializedFlowNodeDefinition)_.Clone()).ToList(),
         ElementInstances = ElementInstances.Select(_ => (FlowNodeInstance)_.Clone()).ToList(),
         ExecutionPathLst = ExecutionPathLst.Select(_ => (ExecutionPath)_.Clone()).ToList(),
         ItemDefs = ItemDefs.Select(_ => (ItemDefinition)_.Clone()).ToList(),
         Messages = Messages.Select(_ => (Message)_.Clone()).ToList(),
         Interfaces = Interfaces.Select(_ => (BPMNInterface)_.Clone()).ToList(),
         StateTransitions = StateTransitions.Select(_ => (StateTransitionToken)_.Clone()).ToList()
     });
 }
 public override object Clone()
 {
     return(new ProcessInstanceAggregate
     {
         AggregateId = AggregateId,
         ProcessFileId = ProcessFileId,
         ProcessFileName = ProcessFileName,
         Version = Version,
         CreateDateTime = CreateDateTime,
         UpdateDateTime = UpdateDateTime,
         Status = Status,
         SequenceFlows = new ConcurrentBag <SequenceFlow>(SequenceFlows.Select(_ => (SequenceFlow)_.Clone())),
         ElementDefs = new ConcurrentBag <BaseFlowNode>(ElementDefs.Select(_ => (BaseFlowNode)_.Clone())),
         ElementInstances = new ConcurrentBag <FlowNodeInstance>(ElementInstances.Select(_ => (FlowNodeInstance)_.Clone())),
         ExecutionPathLst = new ConcurrentBag <ExecutionPath>(ExecutionPathLst.Select(_ => (ExecutionPath)_.Clone())),
         ItemDefs = new ConcurrentBag <ItemDefinition>(ItemDefs.Select(_ => (ItemDefinition)_.Clone())),
         Messages = new ConcurrentBag <Message>(Messages.Select(_ => (Message)_.Clone())),
         Interfaces = new ConcurrentBag <BPMNInterface>(Interfaces.Select(_ => (BPMNInterface)_.Clone())),
         StateTransitions = new ConcurrentBag <StateTransitionNotification>(StateTransitions.Select(_ => (StateTransitionNotification)_.Clone()))
     });
 }