0

似乎有一种方法可以实现非轮询机制来完成本页所述的工作项:https ://forge.autodesk.com/en/docs/design-automation/v3/developers_guide/basics/ 但是我找不到使用 api 指定它的方法。我应该在工作项中定义什么以在特定端点上进行回调?

这是我已经拥有的:

var workITem = new WorkItem
            {
                ActivityId = Services.ForgeService.CleanActivityId,
                Arguments = new Dictionary<string, IArgument>
                {
                    {
                        "dwg",
                        new XrefTreeArgument
                        {
                            Url = inputUrl,
                            Verb = Verb.Get
                        }
                    },
                    {
                        "results",
                        new XrefTreeArgument
                        {
                            Verb = Verb.Put,
                            Headers = new Dictionary<string, string>
                            {
                                {"Authorization", $"Bearer {token}"}
                            },
                            Url = outputUrl
                        }
                    }
                }
            };

谢谢。

4

1 回答 1

0

罗曼,

请阅读LearnForge教程

string callbackUrl = "Your Callback Url";
    WorkItem workItemSpec = new WorkItem()
    {
        ActivityId = activityName,
        Arguments = new Dictionary<string, IArgument>()
        {
            { "inputFile", inputFileArgument },
            { "inputJson",  inputJsonArgument },
            { "outputFile", outputFileArgument },
            { "onComplete", new XrefTreeArgument { Verb = Verb.Post, Url = callbackUrl } }
        }
    };
于 2019-02-05T11:54:12.553 回答