简体   繁体   English

ui路径工作室arguments? 定义为变量或硬编码值

[英]Ui path studio arguments? defined as variables or hard coded values

I was doing practice questions for the rpa asociate exam and came across a question I was unsure on how to answer.我正在为 rpa asciate 考试做练习题,遇到了一个我不确定如何回答的问题。

Suppose you have some arguments from an invoked workflow.假设您从调用的工作流中获得一些 arguments。 Some are out arguments, some are in and some are in/out.有些是 arguments,有些是进,有些是进/出。 The question asked which types of arguments supported being mapped to variables and which supported being mapped to hard coded values.该问题询问哪些类型的 arguments 支持映射到变量,哪些支持映射到硬编码值。

I didn't find much on the documentation expect a generic paragraph on arguments as a whole that said that you could map them to both variables and hard coded values regardless of direction.我没有在文档中找到太多关于 arguments 的通用段落作为一个整体说你可以将它们 map 到变量和硬编码值而不考虑方向。

TL;DR - If you hardcode a value to an Out or In/Out, the Out value produced cannot map to the Out argument and will not be used further down the line. TL;DR - 如果您将一个值硬编码为 Out 或 In/Out,则生成的 Out 值不能 map 到 Out 参数,并且不会进一步使用。

While it is probably allowed by UiPath Studio to add hardcoded values to Out or In/Out arguments, it would effectively break your automation by the nature of what an Out argument actually does.虽然 UiPath Studio 可能允许将硬编码值添加到 Out 或 In/Out arguments,但它会根据 Out 参数实际作用的性质有效地破坏您的自动化。

When thinking through it, if you were to add a hardcoded value as the result of an Out or In/Out argument, all work done while the workflow is invoked would not be passed back to the invoking workflow when it is finished, since the out value produced is not able to replace a hardcoded value.仔细想想,如果您要添加硬编码值作为 Out 或 In/Out 参数的结果,则在调用工作流时完成的所有工作都不会在完成时传递回调用工作流,因为 out产生的价值无法替代硬编码的价值。 An In argument, on the other hand, would work just as well whether the value is a variable or hard-coded, since that value is no longer needed as soon as the workflow that is being invoked starts (however, in most cases, it is probably still best practice to use a variable even for an In).另一方面,无论值是变量还是硬编码,In 参数都可以正常工作,因为一旦被调用的工作流开始就不再需要该值(但是,在大多数情况下,它即使对于 In),使用变量可能仍然是最佳实践。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM