您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

使用 Azure 逻辑应用和 IBM 3270 连接器将 IBM 大型机上的 3270 屏幕驱动的应用集成到 AzureIntegrate 3270 screen-driven apps on IBM mainframes with Azure by using Azure Logic Apps and IBM 3270 connector

使用 Azure 逻辑应用和 IBM 3270 连接器,可以访问和运行通常通过浏览 3270 模拟器屏幕驱动的 IBM 大型机应用。With Azure Logic Apps and the IBM 3270 connector, you can access and run IBM mainframe apps that you usually drive by navigating through 3270 emulator screens. 这样,便可以通过使用 Azure 逻辑应用创建自动化工作流,将 IBM 大型机应用与 Azure、Microsoft 及其他应用、服务和系统集成。That way, you can integrate your IBM mainframe apps with Azure, Microsoft, and other apps, services, and systems by creating automated workflows with Azure Logic Apps. 连接器使用 TN3270 协议与 IBM 大型机通信,并在除 Azure 政府和 Azure 中国世纪互联以外的所有 Azure 逻辑应用区域中提供。The connector communicates with IBM mainframes by using the TN3270 protocol and is available in all Azure Logic Apps regions except for Azure Government and Azure China 21Vianet. 如果你不熟悉逻辑应用,请查看什么是 Azure 逻辑应用?If you're new to logic apps, review What is Azure Logic Apps?

本文介绍 3270 连接器的以下方面:This article describes these aspects for using the 3270 connector:

  • 为何要在 Azure 逻辑应用中使用 IBM 3270 连接器,以及该连接器如何运行 3270 屏幕驱动的应用Why use the IBM 3270 connector in Azure Logic Apps and how the connector runs 3270 screen-driven apps

  • 3270 连接器的先决条件及其设置方法The prerequisites and setup for using the 3270 connector

  • 将 3270 连接器操作添加到逻辑应用的步骤The steps for adding 3270 connector actions to your logic app

为何要使用此连接器?Why use this connector?

若要访问 IBM 大型机上的应用,你往往会使用一个 3270 终端仿真器(通常称为“绿屏”)。To access apps on IBM mainframes, you typically use a 3270 terminal emulator, often called a "green screen". 此方法经过了时间的考验,但存在限制。This method is a time-tested way but has limitations. 尽管 Host Integration Server (HIS) 可帮助你直接处理这些应用,但有时可能无法将屏幕和业务逻辑相隔离。Although Host Integration Server (HIS) helps you work directly with these apps, sometimes, separating the screen and business logic might not be possible. 或者,你可能不再拥有有关主机应用程序工作原理的信息。Or, maybe you no longer have information for how the host applications work.

为了扩展这些方案,Azure 逻辑应用中的 IBM 3270 连接器将与 3270 设计工具协调工作。使用该工具可以录制(或“捕获”)用于特定任务的主机屏幕,通过大型机应用定义该任务的导航流,以及使用该任务的输入和输出参数定义方法。To extend these scenarios, the IBM 3270 connector in Azure Logic Apps works with the 3270 Design Tool, which you use to record, or "capture", the host screens used for a specific task, define the navigation flow for that task through your mainframe app, and define the methods with input and output parameters for that task. 该设计工具会将该信息转换为元数据,3270 连接器在从逻辑应用调用代表该任务的操作时可以使用这些元数据。The design tool converts that information into metadata that the 3270 connector uses when calling an action that represents that task from your logic app.

在设计工具中生成元数据文件后,将该文件添加到 Azure 中的集成帐户。After you generate the metadata file from the design tool, you add that file to an integration account in Azure. 这样,在添加 3270 连接器操作时,逻辑应用便可以访问应用的元数据。That way, your logic app can access your app's metadata when you add a 3270 connector action. 该连接器从集成帐户读取元数据文件,通过 3270 屏幕处理导航,并动态显示 3270 连接器操作的参数。The connector reads the metadata file from your integration account, handles navigation through the 3270 screens, and dynamically presents the parameters for the 3270 connector action. 然后,可将数据提供给主机应用程序,而连接器会将结果返回给逻辑应用。You can then provide data to the host application, and the connector returns the results to your logic app. 这样,便可将传统应用与 Azure、Microsoft,以及 Azure 逻辑应用支持的其他应用、服务和系统相集成。That way, you can integrate your legacy apps with Azure, Microsoft, and other apps, services, and systems that Azure Logic Apps supports.

先决条件Prerequisites

  • Azure 订阅。An Azure subscription. 如果没有 Azure 订阅,请注册一个免费 Azure 帐户If you don't have an Azure subscription, sign up for a free Azure account.

  • 有关如何创建逻辑应用的基本知识Basic knowledge about how to create logic apps

  • 建议:集成服务环境 (ISE)Recommended: An integration service environment (ISE)

    可以选择此环境作为创建和运行逻辑应用的位置。You can select this environment as the location for creating and running your logic app. 在 ISE 中可以从逻辑应用访问在 Azure 虚拟网络中受保护的资源。An ISE provides access from your logic app to resources that are protected inside Azure virtual networks.

  • 用于自动化和运行 3270 屏幕驱动的应用的逻辑应用The logic app to use for automating and running your 3270 screen-driven app

    IBM 3270 连接器没有触发器,因此,请使用另一个触发器(例如“重复”触发器)来启动逻辑应用。The IBM 3270 connector doesn't have triggers, so use another trigger to start your logic app, such as the Recurrence trigger. 然后可以添加 3270 连接器操作。You can then add 3270 connector actions. 若要开始,请创建一个空白逻辑应用To get started, create a blank logic app. 如果使用某个 ISE,请选择该 ISE 作为逻辑应用的位置。If you use an ISE, select that ISE as your logic app's location.

  • 下载并安装 3270 设计工具Download and install the 3270 Design Tool. 唯一的必备组件是 Microsoft .NET Framework 4.8The only prerequisite is Microsoft .NET Framework 4.8.

    此工具可帮助你在应用中录制任务的屏幕、导航路径、方法,以及添加的并作为 3270 连接器操作运行的参数。This tool helps you record the screens, navigation paths, methods, and parameters for the tasks in your app that you add and run as 3270 connector actions. 该工具会生成一个主机集成设计器 XML (HIDX) 文件,该文件提供连接器在驱动大型机应用时使用的所需元数据。The tool generates a Host Integration Designer XML (HIDX) file that provides the necessary metadata for the connector to use for driving your mainframe app.

    下载并安装此工具后,请遵循以下步骤连接到主机:After downloading and installing this tool, follow these steps for connecting to your host:

    1. 打开 3270 设计工具。Open the 3270 Design Tool. 在“会话”菜单中,选择“主机会话”。From the Session menu, select Host Sessions.

    2. 提供 TN3270 主机服务器信息。Provide your TN3270 host server information.

  • 一个集成帐户,将在其中以映射的形式存储 HIDX 文件,使逻辑应用能够访问该文件中的元数据和方法定义。An integration account, which is the place where you store your HIDX file as a map so your logic app can access the metadata and method definitions in that file.

    请确保该集成帐户已链接到所用的逻辑应用。Make sure your integration account is linked to the logic app you're using. 此外,如果使用某个 ISE,请确保集成帐户的位置是逻辑应用使用的同一 ISE。Also, if you use an ISE, make sure your integration account's location is the same ISE that your logic app uses.

  • 访问托管大型机应用的 TN3270 服务器Access to the TN3270 server that hosts your mainframe app

创建元数据概述Create metadata overview

在 3270 屏幕驱动的应用中,屏幕和数据字段对于方案而言是唯一的,因此,3270 连接器需要有关应用的此信息,你可以元数据的形式提供此信息。In a 3270 screen-driven app, the screens and data fields are unique to your scenarios, so the 3270 connector needs this information about your app, which you can provide as metadata. 此元数据描述可帮助逻辑应用标识和识别屏幕的信息,并描述如何在屏幕之间导航、数据输入位置,以及结果的预期显示位置。This metadata describes information that helps your logic app identify and recognize screens, describes how to navigate between screens, where to input data, and where to expect results. 若要指定并生成此元数据,请使用 3270 设计工具,它会引导你完成这些特定的模式或阶段,本文稍后会提供更多详细信息:To specify and generate this metadata, you use the 3270 Design Tool, which walks you through these specific modes, or stages, as described later in more details:

  • “捕获”:在此模式下,记录使用大型机应用完成特定任务所需的屏幕,例如,获取银行余额。Capture: In this mode, you record the screens required for completing a specific task with your mainframe app, for example, getting a bank balance.

  • “导航”:在此模式下指定有关如何针对特定的任务浏览大型机应用屏幕的计划或路径。Navigation: In this mode, you specify the plan or path for how to navigate through your mainframe app's screens for the specific task.

  • “方法”:在此模式下定义用于描述屏幕导航路径的方法,例如 GetBalanceMethods: In this mode, you define the method, for example, GetBalance, that describes the screen navigation path. 还可以选择每个屏幕中要用作方法的输入和输出参数的字段。You also select the fields on each screen that become the method's input and output parameters.

不支持的元素Unsupported elements

设计工具不支持以下元素:The design tool doesn't support these elements:

  • 部分 IBM 基本映射支持 (BMS) 映射:如果导入 BMS 映射,设计工具将忽略部分屏幕定义。Partial IBM Basic Mapping Support (BMS) maps: If you import a BMS map, the design tool ignores partial screen definitions.

  • 菜单处理Menu processing

捕获屏幕Capture screens

在此模式下,可在每个 3270 屏幕中标记一个用于唯一标识该屏幕的项。In this mode, you mark an item on each 3270 screen that uniquely identifies that screen. 例如,可以指定一行文本或一组更复杂的条件,例如特定的文本和非空字段。For example, you might specify a line of text or a more complex set of conditions, such as specific text and a non-empty field. 可以通过与主机服务器建立的实时连接来录制这些屏幕,或者从 IBM 基本映射支持 (BMS) 映射导入此信息。You can either record these screens over a live connection to the host server, or import this information from an IBM Basic Mapping Support (BMS) map. 该实时连接使用 TN3270 仿真器连接到主机。The live connection uses a TN3270 emulator for connecting to the host. 每个连接器的操作必须映射到单个任务,该任务最初是连接到会话,最后是断开会话的连接。Each connector action must map to a single task that starts with connecting to your session and ends with disconnecting from your session.

  1. 如果尚未打开 3270 设计工具,请将其打开。If you haven't already, open the 3270 Design Tool. 在工具栏中,选择“捕获”进入捕获模式。On the toolbar, select Capture so that you enter Capture mode.

  2. 在“会话”菜单中,选择“连接”。From the Session menu, select Connect.

  3. 若要开始录制,在“录制”菜单中选择“开始录制”。 To start recording, from the Recording menu, select Start Recording. (键盘:Ctrl + E)(Keyboard: Ctrl + E)

  4. 在“捕获”窗格中,从应用的第一个屏幕开始,针对要录制的特定任务逐步运行应用。In the Capture pane, starting from the first screen in your app, step through your app for the specific task that you're recording.

  5. 完成该任务后,像往常一样从应用注销。After you finish the task, sign out from your app as you usually do.

  6. 在“会话”菜单中,选择“断开连接”。From the Session menu, select Disconnect.

  7. 若要停止录制,在“录制”菜单中选择“停止录制”。 To stop recording, from the Recording menu, select Stop Recording. (键盘:Ctrl + Shift + E)(Keyboard: Ctrl + Shift + E)

    捕获任务的屏幕后,设计器工具会显示表示这些屏幕的缩略图。After you capture the screens for a task, the designer tool shows thumbnails that represent those screens. 有关这些缩略图的一些说明:Some notes about these thumbnails:

    • 捕获的屏幕中包括一个名为“空”的屏幕。Included with your captured screens, you have a screen that's named "Empty".

      首次连接到 CICS 时,必须先发送“清空”键,然后才能输入所要运行的事务的名称。When you first connect to CICS, you must send the "Clear" key before you can enter the name for the transaction you want to run. 在其中发送“清空”键的屏幕不包含任何识别属性(例如屏幕标题),可以使用屏幕识别编辑器添加此类属性。The screen where you send the "Clear" key doesn't have any recognition attributes, such as a screen title, which you can add by using the Screen Recognition editor. 缩略图包含名为“空”的屏幕用于表示此屏幕。To represent this screen, the thumbnails includes a screen named "Empty". 稍后可以使用此屏幕来表示要在其中输入事务名称的屏幕。You can later use this screen for representing the screen where you enter the transaction name.

    • 默认情况下,捕获的屏幕的名称使用屏幕上的第一个单词。By default, the name for a captured screen uses the first word on the screen. 如果该名称已存在,则设计工具会在名称的后面追加一个下划线和数字,例如“WBGB”和“WBGB_1”。If that name already exists, the design tool appends the name with an underscore and a number, for example, "WBGB" and "WBGB_1".

  8. 若要为捕获的屏幕提供更有意义的名称,请执行以下步骤:To give a more meaningful name to a captured screen, follow these steps:

    1. 在“主机屏幕”窗格中,选择要重命名的屏幕。In the Host Screens pane, select the screen you want to rename.

    2. 在同一窗格中的底部附近,找到“屏幕名称”属性。In the same pane, near the bottom in the same pane, find the Screen Name property.

    3. 将当前屏幕名称更改为更具描述性的名称。Change the current screen name to a more descriptive name.

  9. 现在,指定用于标识每个屏幕的字段。Now specify the fields for identifying each screen.

    对于 3270 数据流,屏幕不包含默认标识符,因此你需要在每个屏幕上选择唯一的文本。With the 3270 data stream, screens don't have default identifiers, so you need to select unique text on each screen. 对于复杂方案,可以指定多个条件,例如,唯一的文本以及附带特定条件的字段。For complex scenarios, you can specify multiple conditions, for example, unique text and a field with a specific condition.

选择识别字段后,转到下一模式。After you finish selecting the recognition fields, move to the next mode.

用于标识重复屏幕的条件Conditions for identifying repeated screens

为使连接器在屏幕之间导航以及区分不同的屏幕,通常需要查找用作不同捕获屏幕之间的标识符的唯一文本。For the connector to navigate and differentiate between screens, you usually find unique text on a screen that you can use as an identifier among the captured screens. 对于重复的屏幕,可能需要更多的标识方法。For repeated screens, you might need more identification methods. 例如,假设有两个屏幕的外观相同,但其中一个屏幕返回有效值,而另一个屏幕返回错误消息。For example, suppose you have two screens that look the same except one screen returns a valid value, while the other screen returns an error message.

在设计工具中,可以使用屏幕识别编辑器添加识别属性,例如,屏幕标题“获取帐户余额”。In the design tool, you can add recognition attributes, for example, a screen title such as "Get Account Balance", by using the Screen Recognition editor. 如果存在分叉的路径,并且两个分支返回相同的屏幕但不同的结果,则你需要添加其他识别属性。If you have a forked path and both branches return the same screen but with different results, you need other recognition attributes. 在运行时,连接器将使用这些属性来确定当前分支和分叉。At run time, the connector uses these attributes for determining the current branch and fork. 下面是可以使用的条件:Here are the conditions you can use:

  • 特定值:此值与指定位置的指定字符串相匹配。Specific value: This value matches the specified string at the specified location.
  • 非特定值:此值与指定位置的指定字符串不匹配。NOT a specific value: This value doesn't match the specified string at the specified location.
  • 空:该字段为空。Empty: This field is empty.
  • 非空:此字段不为空。NOT empty: This field isn't empty.

有关详细信息,请参阅本主题稍后所述的示例导航计划To learn more, see the Example navigation plan later in this topic.

定义导航计划Define navigation plans

在此模式下,定义有关浏览特定任务的大型机应用屏幕的流或步骤。In this mode, you define the flow or steps for navigating through your mainframe app's screens for your specific task. 例如,应用有时可能会采用多个路径,其中一个路径生成正确的结果,而另一个路径生成错误。For example, sometimes, you might have more than one path that your app can take where one path produces the correct result, while the other path produces an error. 对于每个屏幕,请指定所需的击键以转到下一个屏幕,例如 CICSPROD <enter>For each screen, specify the keystrokes necessary for moving to the next screen, such as CICSPROD <enter>.

提示

如果你正在自动化使用相同连接和断开连接屏幕的多个任务,设计工具会提供特殊的连接和断开连接计划类型。If you're automating several tasks that use the same connect and disconnect screens, the design tool provides special Connect and Disconnect plan types. 定义这些计划时,可将其添加到导航计划的开头和末尾。When you define these plans, you can add them to your navigation plan's beginning and end.

计划定义的准则Guidelines for plan definitions

  • 包含所有屏幕,以连接开始,以断开连接结束。Include all screens, starting with connecting and ending with disconnecting.

  • 可以创建独立的计划,或者使用连接和断开连接计划,这样就可以重复使用所有事务通用的一系列屏幕。You can create a standalone plan or use the Connect and Disconnect plans, which let you reuse a series of screens common to all your transactions.

    • 连接计划中的最后一个屏幕必须是导航计划中的第一个屏幕。The last screen in your Connect plan must be the same screen as the first screen in your navigation plan.

    • 断开连接计划中的第一个屏幕必须是导航计划中的最后一个屏幕。The first screen in your Disconnect plan must be same screen as the last screen in your navigation plan.

  • 捕获的屏幕可能包含许多重复的屏幕,因此,请对计划中的任何重复屏幕仅选择并使用一个实例。Your captured screens might contain many repeated screens, so select and use only one instance of any repeated screens in your plan. 下面是重复屏幕的一些示例:Here are some examples of repeated screens:

    • 登录屏幕,例如“MSG-10”屏幕The sign-in screen, for example, the MSG-10 screen
    • CICS 的欢迎屏幕The welcome screen for CICS
    • “清空”或“空”屏幕The "Clear" or Empty screen

创建计划Create plans

  1. 在 3270 设计工具的工具栏上,选择“导航”以进入导航模式。On the 3270 Design Tool's toolbar, select Navigation so that you enter Navigation mode.

  2. 若要开始创建计划,请在“导航”窗格中选择“新建计划”。 To start your plan, in the Navigation pane, select New Plan.

  3. 在“选择新计划名称”下,输入计划的名称。Under Choose New Plan Name, enter a name for your plan. 从“类型”列表中选择计划类型:From the Type list, select the plan type:

    计划类型Plan type 描述Description
    ProcessProcess 适用于独立计划或组合计划For standalone or combined plans
    “连接”Connect 适用于连接计划For Connect plans
    断开连接Disconnect 适用于断开连接计划For Disconnect plans
  4. 在“主机屏幕”窗格中,将捕获的缩略图拖放到“导航”窗格中的导航计划图面。From the Host Screens pane, drag the captured thumbnails to the navigation plan surface in the Navigation pane.

    若要显示用于输入事务名称的空白屏幕,请使用“空”屏幕。To represent the blank screen where you enter the transaction name, use the "Empty" screen.

  5. 按照所要定义的任务的描述顺序排列屏幕。Arrange the screens in the order that describes the task that you're defining.

  6. 若要定义屏幕之间的流路径(包括分叉和联接),请在设计工具的工具栏上选择“流”。To define the flow path between screens, including forks and joins, on the design tool's toolbar, select Flow.

  7. 选择流中的第一个屏幕。Choose the first screen in the flow. 将某个连接拖动并绘制到流中的下一个屏幕。Drag and draw a connection to the next screen in the flow.

  8. 对于每个屏幕,提供“AID 键”属性(注意标识符)和“固定文本”属性的值,以便将流转到下一屏幕。For each screen, provide the values for the AID Key property (Attention Identifier) and for the Fixed Text property, which moves the flow to the next screen.

    可以仅输入 AID 键,或同时输入 AID 键和固定文本。You might have just the AID key, or both the AID key and fixed text.

完成导航计划后,可以在下一模式下定义方法After you finish your navigation plan, you can define methods in the next mode.

示例Example

此示例假设运行包含以下步骤的名为“WBGB”的 CICS 事务:In this example, suppose you run a CICS transaction named "WBGB" that has these steps:

  • 在第一个屏幕上输入名称和帐户。On the first screen, you enter a name and an account.
  • 在第二个屏幕上获取帐户余额。On the second screen, you get the account balance.
  • 退出并转到“空”屏幕。You exit to the "Empty" screen.
  • 从 CICS 注销并转到“MSG-10”屏幕。You sign out from CICS to the "MSG-10" screen.

另外,假设你要重复这些步骤,但会输入错误的数据,以便可以捕获显示错误的屏幕。Also suppose that you repeat these steps, but you enter incorrect data so you can capture the screen that shows the error. 下面是捕获的屏幕:Here are the screens you capture:

  • MSG-10MSG-10
  • CICS 欢迎CICS Welcome
  • Empty
  • WBGB_1(输入)WBGB_1 (input)
  • WBGB_2(错误)WBGB_2 (error)
  • Empty_1Empty_1
  • MSG-10_1MSG-10_1

尽管此处的许多屏幕使用唯一的名称,但某些屏幕是相同的,例如“MSG-10”和“空”。Although many screens here get unique names, some screens are the same screen, for example, "MSG-10" and "Empty". 对于重复的屏幕,请在计划中对该屏幕仅使用一个实例。For a repeated screen, use only one instance for that screen in your plan. 以下示例显示了独立计划、连接计划、断开连接计划和组合计划的外观:Here are examples that show how a standalone plan, Connect plan, Disconnect plan, and a combined plan might look:

  • 独立计划Standalone plan

    独立导航计划

  • 连接计划Connect plan

    连接计划

  • 断开连接计划Disconnect plan

    断开连接计划

  • 组合计划Combined plan

    组合计划

示例:标识重复的屏幕Example: Identify repeated screens

为使连接器在屏幕之间导航以及区分不同的屏幕,通常需要查找用作不同捕获屏幕的标识符的唯一文本。For the connector to navigate and differentiate screens, you usually find unique text on a screen that you can use as an identifier across the captured screens. 对于重复的屏幕,可能需要更多的标识方法。For repeated screens, you might need more identification methods. 示例计划包含一个分叉,可在其中获取类似的屏幕。The example plan has a fork where you can get screens that look similar. 其中一个屏幕返回帐户余额,另一个屏幕返回错误消息。One screen returns an account balance, while the other screen returns an error message.

在设计工具中,可以使用屏幕识别编辑器添加识别属性,例如,名为“获取帐户余额”的屏幕标题。The design tool lets you add recognition attributes, for example, a screen title named "Get Account Balance", by using the Screen Recognition editor. 对于类似的屏幕,需要添加其他属性。In the case with similar screens, you need other attributes. 在运行时,连接器将使用这些属性来确定分支和分叉。At run time, the connector uses these attributes for determining the branch and fork.

  • 在返回有效输入的分支(包含帐户余额的屏幕)中,可以添加附带“不为空”条件的字段。In the branch that returns valid input, which is the screen with the account balance, you can add a field that has a "not empty" condition.

  • 在返回错误的分支中,可以添加附带“空”条件的字段。In the branch that returns with an error, you can add a field that has an "empty" condition.

定义方法Define methods

在此模式下,定义一个与导航计划相关联的方法。In this mode, you define a method that's associated with your navigation plan. 对于每个方法参数,请指定字符串、整数、日期或时间等数据类型。For each method parameter, you specify the data type, such as a string, integer, date or time, and so on. 完成后,可以在实时主机上测试该方法,并确认该方法是否按预期方式工作。When you're done, you can test your method on the live host and confirm that the method works as expected. 然后生成元数据文件或主机集成设计器 XML (HIDX) 文件,该文件现在包含用于为 IBM 3270 连接器创建和运行操作的方法定义。You then generate the metadata file, or Host Integration Designer XML (HIDX) file, which now has the method definitions to use for creating and running an action for the IBM 3270 connector.

  1. 在 3270 设计工具的工具栏上,选择“方法”以进入“方法”模式。On the 3270 Design Tool's toolbar, select Methods so that you enter Methods mode.

  2. 在“导航”窗格中,选择包含所需输入字段的屏幕。In the Navigation pane, select the screen that has the input fields you want.

  3. 若要添加方法的第一个输入参数,请执行以下步骤:To add the first input parameter for your method, follow these steps:

    1. 在 3270 仿真器屏幕上的“捕获”窗格中选择整个字段,而不仅仅是该字段中要用作第一个输入的文本。In the Capture pane, on the 3270 emulator screen, select the whole field, not just text inside the field, that you want as the first input.

      提示

      若要显示所有字段,并确保选择整个字段,并在“视图”菜单中选择“所有字段”。To display all the fields and make sure that you select the complete field, on the View menu, select All Fields.

    2. 在设计工具的工具栏上,选择“输入字段”。On the design tool's toolbar, select Input Field.

    若要添加更多的输入参数,请针对每个参数重复上述步骤。To add more input parameters, repeat the previous steps for each parameter.

  4. 若要添加方法的第一个输出参数,请执行以下步骤:To add the first output parameter for your method, follow these steps:

    1. 在 3270 仿真器屏幕上的“捕获”窗格中选择整个字段,而不仅仅是该字段中要用作第一个输出的文本。In the Capture pane, on the 3270 emulator screen, select the whole field, not just text inside the field, that you want as the first output.

      提示

      若要显示所有字段,并确保选择整个字段,并在“视图”菜单中选择“所有字段”。To display all the fields and make sure that you select the complete field, on the View menu, select All Fields.

    2. 在设计工具的工具栏上,选择“输出字段”。On the design tool's toolbar, select Output Field.

    若要添加更多的输出参数,请针对每个参数重复上述步骤。To add more output parameters, repeat the previous steps for each parameter.

  5. 添加方法的所有参数后,请定义每个参数的以下属性:After you add all your method's parameters, define these properties for each parameter:

    属性名称Property name 可能值Possible values
    数据类型Data Type 字节、日期时间、小数、整数、长整数、短整数、字符串Byte, Date Time, Decimal, Int, Long, Short, String
    字段填充方法Field Fill Technique 参数支持以下填充类型,必要时留空:Parameters support these fill types, filling with blanks if necessary:

    - “类型”:在字段中按顺序输入字符。- Type: Enter characters sequentially into the field.

    - “填充”:将字段内容替换为字符,必要时留空。- Fill: Replace the field's contents with characters, filling with blanks if necessary.

    - “EraseEofType”:清除字段,然后在字段中按顺序输入字符。- EraseEofType: Clear the field, and then enter characters sequentially into the field.

    格式字符串Format String 某些参数数据类型使用格式字符串,告知 3270 连接器如何将屏幕中的文本转换为 .NET 数据类型:Some parameter data types use a format string, which informs the 3270 connector how to convert text from the screen into a .NET data type:

    - “日期时间”:日期时间格式字符串遵循 .NET 自定义日期和时间格式字符串- DateTime: The DateTime format string follows the .NET custom date and time format strings. 例如,日期 06/30/2019 使用格式字符串 MM/dd/yyyyFor example, the date 06/30/2019 uses the format string MM/dd/yyyy.

    - “小数”:小数格式字符串使用 COBOL Picture 子句- Decimal: The decimal format string uses the COBOL Picture clause. 例如,数字 100.35 使用格式字符串 999V99For example, the number 100.35 uses the format string 999V99.

保存并查看元数据Save and view metadata

定义方法之后、测试方法之前,请将截止目前定义的所有信息保存到某个 RAP (.rap) 文件。After you define your method, but before you test your method, save all the information that you defined so far to a RAP (.rap) file. 在任何模式下,随时可将信息保存到此 RAP 文件中。You can save to this RAP file at any time during any mode. 设计工具还包含一个示例 RAP 文件。浏览到设计工具的安装文件夹并打开“WoodgroveBank.rap”文件即可查看该文件:The design tool also includes a sample RAP file that you can open and review by browsing to the design tool's installation folder at this location and opening the "WoodgroveBank.rap" file:

..\Program Files\Microsoft Host Integration Server - 3270 Design Tool\SDK\WoodgroveBank.rap

但是,如果在示例 RAP 文件仍保留在设计工具的安装文件夹中的情况下尝试保存对该文件所做的更改,或者基于该文件生成 HIDX 文件,可能会收到“拒绝访问”错误。However, if you try saving changes to the sample RAP file or generating an HIDX file from the sample RAP file while the file stays in the design tool's installation folder, you might get an "access denied" error. 默认情况下,设计工具安装在 Program Files 文件夹中且不提供提升的权限。By default, the design tool installs in your Program Files folder without elevated permissions. 如果出现错误,请尝试以下解决方法之一:If you get an error, try one of these solutions:

  • 将示例文件复制到另一个位置。Copy the sample file to a different location.
  • 以管理员身份运行设计工具。Run the design tool as an administrator.
  • 使自己成为 SDK 文件夹的所有者。Make yourself the owner for the SDK folder.

测试方法Test your method

  1. 若要针对实时主机运行上述方法,请在仍处于“方法”模式的情况下按 F5 键,或者在设计工具的工具栏中选择“测试”。To run your method against the live host, while still in Methods mode, press the F5 key, or from the design tool's toolbar, select Test.

    提示

    随时可以更改模式。You can change modes at any time. 在“文件”菜单中选择“模式”,然后选择所需的模式即可。On the File menu, select Mode, and then select the mode you want.

  2. 请输入参数的值,并选择“确定”。Enter your parameters' values, and select OK.

  3. 若要转到下一屏幕,请选择“下一步”。To continue to the next screen, select Next.

  4. 完成后,请选择“完成”,显示输出参数值。When you're finished, select Done, which shows your output parameter values.

生成并上传 HIDX 文件Generate and upload HIDX file

准备就绪后,请生成 HIDX 文件,以便可以上传到集成帐户。When you're ready, generate the HIDX file so you can upload to your integration account. 3270 设计工具将在保存 RAP 文件的新子文件夹中创建 HIDX 文件。The 3270 Design Tool creates the HIDX file in a new subfolder where you saved your RAP file.

  1. 在 3270 设计工具中,从“工具”菜单中,选择“生成定义”。 In the 3270 Design Tool, from the Tools menu, select Generate Definitions. (键盘:F6)(Keyboard: F6)

  2. 转到包含 RAP 文件的文件夹,然后打开该工具在生成 HIDX 文件后创建的子文件夹。Go to the folder that contains your RAP file, and open the subfolder that the tool created after generating your HIDX file. 确认该工具已创建 HIDX 文件。Confirm that the tool created the HIDX file.

  3. 登录到 Azure 门户并找到你的集成帐户。Sign in to the Azure portal, and find your integration account.

  4. 遵循添加映射时使用的类似步骤,将 HIDX 文件作为映射添加到集成帐户,但这一次请选择“HIDX”作为映射类型。Add your HIDX file as a map to your integration account by follow these similar steps for adding maps, but when you select the map type, select HIDX.

在本主题稍后的部分,当你首次将某个 IBM 3270 操作添加到逻辑应用时,系统会提示你通过提供连接信息(例如集成帐户和主机服务器的名称)在逻辑应用与主机服务器之间创建连接。Later in this topic, when you add an IBM 3270 action to your logic app for the first time, you're prompted to create a connection between your logic app and the host server by providing connection information, such as the names for your integration account and host server. 创建连接后,可以选择前面添加的 HIDX 文件、要运行的方法以及要使用的参数。After you create the connection, you can select your previously added HIDX file, the method to run, and the parameters to use.

完成所有这些步骤后,可以使用在逻辑应用中创建的操作连接到 IBM 大型机、驱动应用的屏幕、输入数据、返回结果,等等。When you finish all these steps, you can use the action that you create in your logic app for connecting to your IBM mainframe, drive screens for your app, enter data, return results, and so on. 还可以继续将其他操作添加到逻辑应用,以便与其他应用、服务和系统相集成。You can also continue adding other actions to your logic app for integrating with other apps, services, and systems.

运行 IBM 3270 操作Run IBM 3270 actions

首次添加连接到服务或系统的触发器或操作时,逻辑应用设计器将提示你通过提供必要的信息(具体取决于连接)来创建连接,例如:When you add a trigger or action that connects to a service or system for the first time, the Logic App Designer prompts you to create a connection by providing the necessary information, which varies based on the connection, for example:

  • 要用于新连接的名称The name that you want to use for the new connection

  • 系统或服务器的名称The name for the system or server

  • 用户凭据或帐户凭据Your user or account credentials

  • 要使用的身份验证类型The authentication type to use

  1. 登录到 Azure 门户,在逻辑应用设计器中打开逻辑应用(如果尚未打开)。Sign in to the Azure portal, and open your logic app in Logic App Designer, if not open already.

  2. 在要添加操作的最后一个步骤下,选择“新建步骤” > “添加操作”。 Under the last step where you want to add an action, select New step > Add an action.

  3. 在搜索框下,选择“Enterprise”。Under the search box, select Enterprise. 在搜索框中,输入 3270 作为筛选器。In the search box, enter 3270 as your filter. 从操作列表中,选择名为“通过 TN3270 连接运行大型机程序”的操作From the actions list, select the action named Runs a mainframe program over a TN3270 connection

    选择 3270 操作

    若要在步骤之间添加操作,请将鼠标指针移到步骤之间的箭头上。To add an action between steps, move your pointer over the arrow between steps. 选择出现的加号 ( + ),然后选择“添加操作”。Select the plus sign (+) that appears, and then select Add an action.

  4. 如果连接尚不存在,请提供连接所需的信息,然后选择“创建”。If no connection exists yet, provide the necessary information for your connection, and select Create.

    属性Property 必须Required Value 说明Description
    连接名称Connection Name Yes <connection-name><connection-name> 连接名称The name for your connection
    集成帐户 IDIntegration Account ID Yes <integration-account-name> 集成帐户的名称Your integration account's name
    集成帐户 SAS URLIntegration Account SAS URL Yes <“integration-account-SAS-URL”><integration-account-SAS-URL> 集成帐户的共享访问签名 (SAS) URL,可以在 Azure 门户中基于集成帐户的设置生成此 URL。Your integration account's Shared Access Signature (SAS) URL, which you can generate from your integration account's settings in the Azure portal.

    1.在集成帐户菜单上的“设置”下,选择“回叫 URL”。1. On your integration account menu, under Settings, select Callback URL.
    2.在右侧窗格中,复制“生成的回叫 URL”值。2. In the right-hand pane, copy the Generated Callback URL value.

    服务器Server Yes <“TN3270-server-name”><TN3270-server-name> TN3270 服务的服务器名称The server name for your TN3270 service
    端口Port No <“TN3270-server-port”><TN3270-server-port> TN3270 服务器使用的端口。The port used by your TN3270 server. 如果留空,则连接器将使用 23 作为默认值。If left blank, the connector uses 23 as the default value.
    设备类型Device Type No <“IBM-terminal-model”><IBM-terminal-model> 要仿真的 IBM 终端的机型名称或型号。The model name or number for the IBM terminal to emulate. 如果留空,则连接器将使用默认值。If left blank, the connector uses default values.
    代码页Code Page No <“code-page-number”><code-page-number> 主机的代码页号。The code page number for the host. 如果留空,则连接器将使用 37 作为默认值。If left blank, the connector uses 37 as the default value.
    逻辑单元名称Logical Unit Name No <“logical-unit-name”><logical-unit-name> 要从主机请求的特定逻辑单元名称The specific logical unit name to request from the host
    启用 SSL?Enable SSL? No 打开或关闭On or off 启用或禁用 TLS 加密。Turn on or turn off TLS encryption.
    验证主机 SSL 证书?Validate host ssl certificate? No 打开或关闭On or off 打开或关闭服务器证书验证。Turn on or turn off validation for the server's certificate.

    例如:For example:

    连接属性

  5. 提供操作的所需信息:Provide the necessary information for the action:

    属性Property 必须Required Value 说明Description
    Hidx 名称Hidx Name Yes <“HIDX-file-name”><HIDX-file-name> 选择要使用的 3270 HIDX 文件。Select the 3270 HIDX file that you want to use.
    “方法名称”Method Name Yes <“method-name”><method-name> 选择要使用的 HIDX 文件中的方法。Select the method in the HIDX file that you want to use. 选择方法后,“添加新参数”列表将会显示,可以从中选择要对该方法使用的参数。After you select a method, the Add new parameter list appears so you can select parameters to use with that method.

    例如:For example:

    选择 HIDX 文件Select the HIDX file

    选择 HIDX 文件

    选择方法Select the method

    选择方法

    选择参数。Select the parameters

    选择参数

  6. 完成后,保存并运行逻辑应用。When you're done, save and run your logic app.

    完成运行逻辑应用后,会显示运行的步骤。After your logic app finishes running, the steps from the run appear. 成功的步骤会显示勾选标记,失败的步骤会显示字母“X”。Successful steps show check marks, while unsuccessful steps show the letter "X".

  7. 若要查看每个步骤的输入和输出,请展开该步骤。To review the inputs and outputs for each step, expand that step.

  8. 若要查看输出,请选择“查看原始输出”。To review the outputs, select See raw outputs.

连接器参考Connector reference

有关此连接器的更多技术详细信息,例如触发器、操作和限制(如此连接器的 Swagger 文件所述),请参阅连接器的参考页For more technical details about this connector, such as triggers, actions, and limits as described by the connector's Swagger file, see the connector's reference page.

备注

对于集成服务环境 (ISE) 中的逻辑应用,此连接器的 ISE 标记版本使用 ISE 消息限制For logic apps in an integration service environment (ISE), this connector's ISE-labeled version uses the ISE message limits instead.

后续步骤Next steps