本文整理汇总了C#中ITransaction.IsCompleted方法的典型用法代码示例。如果您正苦于以下问题:C# ITransaction.IsCompleted方法的具体用法?C# ITransaction.IsCompleted怎么用?C# ITransaction.IsCompleted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITransaction
的用法示例。
在下文中一共展示了ITransaction.IsCompleted方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidateTransaction
//验证Transaction
internal void ValidateTransaction(DefaultMessageManager manager, ITransaction parent, ITransaction transaction)
{
if (transaction.Standalone)
{
IList<IMessage> children = transaction.Children;
int len = children.Count;
for (int i = 0; i < len; i++)
{
IMessage message = children[i];
if (message is ITransaction)
{
ValidateTransaction(manager, transaction, message as ITransaction);
}
}
if (!transaction.IsCompleted() && transaction is DefaultTransaction)
{
MarkAsNotCompleted(transaction as DefaultTransaction);
}
else if (!transaction.IsCompleted())
{
if (transaction is DefaultForkedTransaction)
{
LinkAsRunAway(manager, transaction as DefaultForkedTransaction);
}
else if (transaction is DefaultTaggedTransaction)
{
MarkAsRunAway(parent, transaction as DefaultTaggedTransaction);
}
}
}
}
示例2: ValidateTransaction
//验证Transaction
internal void ValidateTransaction(ITransaction transaction)
{
IList<IMessage> children = transaction.Children;
int len = children.Count;
for (int i = 0; i < len; i++)
{
IMessage message = children[i];
var transaction1 = message as ITransaction;
if (transaction1 != null)
{
ValidateTransaction(transaction1);
}
}
if (!transaction.IsCompleted())
{
// missing transaction end, log a BadInstrument event so that
// developer can fix the code
IMessage notCompleteEvent = new DefaultEvent("CAT", "BadInstrument")
{Status = "TransactionNotCompleted"};
notCompleteEvent.Complete();
transaction.AddChild(notCompleteEvent);
transaction.Complete();
}
}
示例3: Validate
//验证Transaction
public void Validate(ITransaction parent, ITransaction transaction)
{
if (transaction.Standalone)
{
IList<IMessage> children = transaction.Children;
int len = children.Count;
for (int i = 0; i < len; i++)
{
IMessage message = children[i];
var childTransaction = message as ITransaction;
if (childTransaction != null)
{
Validate(transaction, childTransaction);
}
}
if (!transaction.IsCompleted() && transaction is DefaultTransaction)
{
// missing transaction end, log a BadInstrument event so that
// developer can fix the code
this.markAsNotCompleted((DefaultTransaction)transaction);
}
}
else if (!transaction.IsCompleted())
{
if (transaction is DefaultForkedTransaction)
{
this.LinkAsRunAway((DefaultForkedTransaction)transaction);
}
else if (transaction is DefaultTaggedTransaction)
{
this.MarkAsRunAway(parent, (DefaultTaggedTransaction)transaction);
}
}
}