当前位置: 首页>>代码示例>>C#>>正文


C# State.ExecuteAsync方法代码示例

本文整理汇总了C#中State.ExecuteAsync方法的典型用法代码示例。如果您正苦于以下问题:C# State.ExecuteAsync方法的具体用法?C# State.ExecuteAsync怎么用?C# State.ExecuteAsync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在State的用法示例。


在下文中一共展示了State.ExecuteAsync方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FailToCollateData

 public async Task<State> FailToCollateData(State redressReview)
 {
     var collateData = redressReview.Transitions.FirstOrDefault(t => t.Name.Equals("Collate Data"));
     return await redressReview.ExecuteAsync(collateData, true);
 }
开发者ID:WELL-E,项目名称:origin,代码行数:5,代码来源:RemediationService.cs

示例2: GetRemediationWorkflow

        private async Task<List<State>> GetRemediationWorkflow()
        {
            var remediationWorkflow = new State(100, "Remediation Workflow", StateType.Root);

            var communication = new Communication()
            {
                Id = 200,
                Name = "Communication"
            };

            var letterSent = new LetterSent()
            {
                Id = 210,
                Name = "Letter Sent"
            };

            var responseReceived = new ResponseReceived()
            {
                Id = 220,
                Name = "Response Received"
            };

            var collateData = new CollateData()
            {
                Id = 300,
                Name = "Collate Data"
            };

            var adjustmentDecision = new AdjustmentDecision()
            {
                Id = 400,
                Name = "Adjustment Decision",
                Type = StateType.Auto
            };

            var adjustment = new Adjustment()
            {
                Id = 500,
                Name = "Adjustment"
            };

            var autoTransitionToRedressReview = new AutoTransitionToRedressReview()
            {
                Id = 600,
                Name = "Auto Transition Redress Review",
                Type = StateType.Auto
            };

            var redressReview = new RedressReview()
            {
                Id = 700,
                Name = "Redress Review"
            };

            var payment = new Payment()
            {
                Id = 800,
                Name = "Payment"
            };

            redressReview
                .AddTransition(payment, true)
                .AddTransition(collateData)
                .AddDependency(communication, true)
                .AddDependency(autoTransitionToRedressReview, true);

            autoTransitionToRedressReview
                .AddDependant(redressReview)
                .AddTransition(redressReview, true);

            adjustment
                .AddTransition(autoTransitionToRedressReview, true);

            adjustmentDecision
                .AddTransition(adjustment)
                .AddTransition(autoTransitionToRedressReview);

            collateData
                .AddTransition(adjustmentDecision, true);

            letterSent
                .AddTransition(responseReceived, true);

            communication
                .AddSubState(letterSent, true)
                .AddSubState(responseReceived)
                .AddDependant(redressReview)
                .AddTransition(redressReview, true);

            remediationWorkflow
                .AddSubState(communication, true)
                .AddSubState(collateData, true)
                .AddSubState(adjustmentDecision)
                .AddSubState(adjustment, completionRequired: false)
                .AddSubState(autoTransitionToRedressReview)
                .AddSubState(redressReview)
                .AddSubState(payment);

            await remediationWorkflow.ExecuteAsync(StateExecutionType.Initialise);

//.........这里部分代码省略.........
开发者ID:WELL-E,项目名称:origin,代码行数:101,代码来源:RemediationService.cs

示例3: CompleteStateAsync

 public async Task<State> CompleteStateAsync(State state)
 {
     return await state.ExecuteAsync(StateExecutionType.Complete);
 }
开发者ID:WELL-E,项目名称:origin,代码行数:4,代码来源:RemediationService.cs


注:本文中的State.ExecuteAsync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。