- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 Azure Durable 函数的新手,一直在关注书中的示例代码 'Azure Serverless Computing Cookbook'我被卡住了,因为我的 Orchestrator 中的 .GetInput 函数返回 null。我的 Blob 触发器正在将文件名作为参数传递给我的 Orchestrator。我认为它调用了错误的重载函数,但不确定如何调用正确的函数。
await starter.StartNewAsync("CSVImport_Orchestrator", name);
[FunctionName("CSVImport_Orchestrator")]
public static async Task<List<string>> RunOrchestrator([OrchestrationTrigger] IDurableOrchestrationContext context)
{
var outputs = new List<string>();
string CSVFileName = context.GetInput<string>(); //<<== returns null???
{
List<Employee> employees = await context.CallActivityAsync<List<Employee>>("ReadCSV_AT", CSVFileName);
}
return outputs;
}
[FunctionName("CSVImportBlobTrigger")]
public static async void Run([BlobTrigger("import-obiee-report/{name}", Connection = "StorageConnection")]Stream myBlob, string name, [DurableClient]IDurableOrchestrationClient starter, ILogger log)
{
string instanceId = await starter.StartNewAsync("CSVImport_Orchestrator", name);
log.LogInformation($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
}
在此先感谢您的帮助。
最佳答案
您正在调用 non-generic overload of StartAsync(string, string)
第二个,string
参数表示 InstanceId 而不是输入参数。还有一个generic overload其中第二个参数代表数据。您正在传递一个 string
所以重载决议看到了两个潜在的候选人。然后它更喜欢非通用的,因为它是 精确 匹配,从而“丢失”您的数据。
如果您真的需要string
对于您的输入数据,您需要明确指定泛型参数以强制编译器选择正确的重载:
await starter.StartAsync<string>("CSVImport_Orchestrator", name);
现在,文档还指出输入应该是一个 JSON 可序列化对象。技术上是
string
是,但我不确定它是如何与编排器的序列化程序一起使用的。您可以改为传递包含您的数据的类。这样做的好处是可以正确推断出泛型参数:
public class Data {
public string Name { get; set; }
}
// calling
await starter.StartAsync("CSVImport_Orchestrator", new Data { Name = name });
// using
var csvFileName = context.GetInput<Data>()?.Name;
关于c# - 持久函数 : How to pass a parameter to the Orchestrator?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66619880/
在处理一个相当大的 BizTalk 2010 项目时,我遇到了这种非常奇怪的行为,并想在这里发布一个解决方案,以防其他人可能遇到这种情况。 尝试在 Visual Studio 2010 中的业务流程设
我正在尝试运行 Azure Orchestrations,突然我开始从 statusQueryGetUri 收到错误: 协调器函数“UploadDocumentOrchestrator”失败:函数“U
Closed. This question is opinion-based。它当前不接受答案。 想改善这个问题吗?更新问题,以便editing this post用事实和引用来回答。 2年前关闭。
我尝试了 Android Test Orchestrator,如果更改了 Application 类,它看不到任何测试。非常容易重现。 在 Android Studio 3 预览版 Beta 6 中使
我有一个非常适合持久函数序列示例的用例:通过三个函数推送 json 有效负载,每个函数都会修改 json 图表并将其转发到下一个函数。 在序列示例中,通过向协调器发出查询来检索序列结果。 在我的用例中
我有一个带有直接绑定(bind)逻辑端口的编排。让我们称之为“O1” O1 订阅消息类型“A”(在接收端口的过滤器属性中指定) 当 O1 收到“A”类型的消息时,它会在完成之前等待一些用户输入。 (这
我是 Azure Durable 函数的新手,一直在关注书中的示例代码 'Azure Serverless Computing Cookbook'我被卡住了,因为我的 Orchestrator 中的
我们目前正在尝试使用 Google 的 Firebase 测试实验室在设备上测试我们的 android 应用。为了测试东西,我创建了一个小应用程序,除了测试之外什么都不做,到目前为止它运行良好,除了推
我一直在使用 UiPath Studio 来自动化工作流程并取得了成功。 现在我想创建一个 UiPath Orchestrator 机器人来部署在我的机器上。 我在 UiPath Orchestrat
从 CI 运行测试时遇到崩溃。阅读这篇关于使用 Android Test Orchestrator 的文章( https://developer.android.com/training/testin
我们正在使用 Azure Functions 和持久框架,在其中“发布”数百万个文件(例如到 blob 存储)。我们有一个“Starter”功能应用程序,它调用 Orchestrator 来发布单个文
我正在将 Azure Durable Function 项目从 .NET Core 2.1 升级到 2.2。我将所有 NuGet 包更新到与 .NET Core 2.2 兼容的最新版本(据我所知)。
我的 Node/Express 项目中有以下代码 exports.getProductById = function(req, res){ db.get('product', req.params
我需要在微服务架构中处理分布式事务。理论上,最好的方法之一是使用 Saga Orchestration 模式。问题是我找不到任何关于如何提供可伸缩性的详细信息。 让我们使用下面的示例。 CreateO
我想在 BizTalk 2010 解决方案中打印我的业务流程。 session 期间,硬拷贝更有助于理解,所以我想打印我的配器。 你对这个问题有什么想法吗? 最佳答案 虽然我自己从未尝试过,但在使用
我的套件中有一个失败的测试,现在我正在使用 Android Orchestrator,但我得到的只是这条消息: Test instrumentation process crashed. Check
我正在寻找您的最佳解决方案,以基于预定义的 XSD 架构创建新的消息实例,以在 Biztalk 编排中使用。 额外的票数用于带有清晰高效示例的答案或带有高质量引用链接的答案。 最佳答案 当想要在 Bi
我定义了三个任务T1、T2和T3,然后定义了一个任务T4,如下: class T4(luigi.Task) def requires(self): return [T1(),
我打算使用 Android Test Orchestrator进入我的测试项目,我注意到在测试套件完成执行后没有生成任何报告。 orchestrator 是否在某处收集了所有测试报告? 最佳答案 An
我一直在使用 UiPath Studio自动化工作流程并取得成功。现在我想创建一个 UiPath Robot仅在我的 localhost 上部署。 我关注了几个视频,例如UiPath Tutorial
我是一名优秀的程序员,十分优秀!