Wonderware

Guide to Using ArchestrA Workflow with Wonderware MES

12/11/12

All rights reserved. No part of this documentation shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of Invensys Systems, Inc. No copyright or patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this documentation, the publisher and the author assume no responsibility for errors or omissions. Neither is any liability assumed for damages resulting from the use of the information contained herein. The information in this documentation is subject to change without notice and does not represent a commitment on the part of Invensys Systems, Inc. The software described in this documentation is furnished under a license or nondisclosure agreement. This software may be used or copied only in accordance with the terms of these agreements.

© 2012 by Invensys Systems, Inc. All rights reserved.
Invensys Systems, Inc. 26561 Rancho Parkway South Lake Forest, CA 92630 U.S.A. (949) 727-3200 http://www.wonderware.com For comments or suggestions about the product documentation, send an e-mail message to ProductDocumentationComments@invensys.com. All terms mentioned in this documentation that are known to be trademarks or service marks have been appropriately capitalized. Invensys Systems, Inc. cannot attest to the accuracy of this information. Use of a term in this documentation should not be regarded as affecting the validity of any trademark or service mark. Alarm Logger, ActiveFactory, ArchestrA, Avantis, DBDump, DBLoad, DT Analyst, Factelligence, FactoryFocus, FactoryOffice, FactorySuite, FactorySuite A2, InBatch, InControl, IndustrialRAD, IndustrialSQL Server, InTouch, MaintenanceSuite, MuniSuite, QI Analyst, SCADAlarm, SCADASuite, SuiteLink, SuiteVoyager, WindowMaker, WindowViewer, Wonderware, Wonderware Factelligence, and Wonderware Logger are trademarks of Invensys plc, its subsidiaries and affiliates. All other brands may be trademarks of their respective owners.

3

Contents

Documentation Conventions ......................................................... 10 Technical Support .......................................................................... 10

Chapter 1

Getting Started.......................................... 11
Prerequisites for Performing the Tests ......................................... Initial Setup ................................................................................... Configuring MES and ArchestrA Workflow Software Users .... Configuring MES - Workflow Connector ................................... Configuring the ArchestrA Workflow Software Repository Database .................................................................................. Logging in to ArchestrA Workflow Software’s Enterprise Console .................................................................................... 11 12 12 12 12 12

Guide to Using ArchestrA Workflow with Wonderware MES

................................. Creating an ArchestrA Workflow Software Form ............................................. Binding the Form to the Workflow ................................. 13 Adding a Job ................ Creating an ArchestrA Workflow Software Form ................ Creating the Workflow ............................................................................................... Creating a Work Order from a Process ....................................................... Sample Test Data and Expected Results ........................ Testing the Workflow ...................................................... 40 40 40 41 41 41 41 42 42 42 43 43 44 44 45 45 45 Guide to Using ArchestrA Workflow with Wonderware MES ........................................... Binding the Form to the Workflow ................. Adding Variables for the DateTime Inputs .... Linking the Workflow Variables to Form Controls .......................... 39 Adding an Item Class .................... 13 14 18 21 23 26 31 32 33 35 35 35 36 36 36 36 37 Chapter 3 Verifying Minimum and Maximum Data .................... Adding an Attribute .................. Linking the Workflow Variables to Form Controls .............. Adding a Variable for the DateTime Input ...................... Creating an ArchestrA Workflow Software Form . Creating the Workflow .................................... Linking the Workflow Variables to Form Controls ..... Testing the Workflow .......................................................................................................................... Publishing the Form .... Sample Test Data and Expected Results ...........4 Contents Chapter 2 Verifying Datatype Compatibility .......................................................... Creating the Workflow ............. Publishing the Form ..................................... Testing the Workflow ................................................................................................................................................................... Creating an ArchestrA Workflow Software Form ......................................................................... Sample Test Data and Expected Results .................................................................................................................................................................................. Publishing the Form ..................................................... Publishing the Form ......... Testing the Workflow ...... Binding the Form to the Workflow .............................................................................................................. Linking the Workflow Variables to Form Controls .................... Creating the Workflow ....................................................................................................................... Binding the Form to the Workflow ............................ Sample Test Data and Expected Results ..

............................................................................................................... 55 Setting the Current Lot Information for a Job ............................................................ Adding a Variable for the DateTime Input ......... 46 46 46 47 47 48 48 48 49 49 49 50 50 50 51 52 52 52 Chapter 4 Verifying Complex Event Types ............................................ Creating the Workflow ................................................................. Linking the Workflow Variables to Form Controls .......................... Creating an ArchestrA Workflow Software Form ........ Linking the Workflow Variables to Form Controls ............................................. Publishing the Form ................... Creating an ArchestrA Workflow Software Form .......................................................................... Linking the Workflow Variables to Form Controls ....................................... Sample Test Data and Expected Results .................... Binding the Form to the Workflow ............... Creating an ArchestrA Workflow Software Form ....................................................... Sample Test Data and Expected Results ............................................ Publishing the Form ........................ Testing the Workflow ............ Starting a Job ............................................. Sample Test Data and Expected Results ........................................... Creating the Workflow ........................................................................ Publishing the Form ........................... Binding the Form to the Workflow ................................ Adding a Variable for the DateTime Input .................. Testing the Workflow . 55 56 56 56 57 57 57 57 58 58 58 59 59 60 60 60 61 Guide to Using ArchestrA Workflow with Wonderware MES ........................... Creating the Workflow ..... Testing the Workflow .............. Binding the Form to the Workflow ............................................... Sample Test Data and Expected Results ...........................................................................................................Contents5 Starting a Job ........................................................ Creating the Workflow ...................................................................................... Adding a Variable for the DateTime Input ..... Binding the Form to the Workflow .......... Testing the Workflow ................... Linking the Workflow Variables to Form Controls ...................... Adding Production to a Job ............................................................. Publishing the Form .................................................................................................................................. Creating an ArchestrA Workflow Software Form .......................................................................................................................

................. Adding a Variable for the DateTime Input .................................. Adding a Variable for the DateTime Input .......................... Publishing the Form .......................................................... Binding the Form to the Workflow ................. 63 64 64 64 65 65 66 67 67 67 68 68 68 69 69 69 70 70 70 Chapter 6 Verifying Localization of Datatypes ...................................................... Publishing the Form .......................... Linking the Workflow Variables to Form Controls ........................................................................................................................ 63 Prerequisites for Performing the Tests .................... Adding a Job—Oracle Database ...................................... Adding Variables for the DateTime Inputs ........................................... Creating the Workflow ................................................. Binding the Form to the Workflow ....... Binding the Form to the Workflow ........ Prerequisites for Performing This Test ......................................... Creating an ArchestrA Workflow Software Form .......... Testing the Workflow ....................... Publishing the Form ................................................................................................................................................................ Binding the Form to the Workflow ........................................................ Creating an ArchestrA Workflow Software Form ... Creating the Workflow ................................................. Creating the Workflow ...................... 73 74 74 74 75 75 75 75 77 78 78 78 79 79 80 80 81 81 Guide to Using ArchestrA Workflow with Wonderware MES ................................................6 Contents Chapter 5 Verifying DateTimes with Different Regional Settings.................................................. Linking the Workflow Variables to Form Controls ............................................ Linking the Workflow Variables to Form Controls ....................................................................................................................... 73 Adding an Item Class—MES SQL Database ............................................................................ Testing the Workflow ....................................................................... Sample Test Data and Expected Results ...................................................................................................... Sample Test Data and Expected Results ... Sample Test Data and Expected Results .................... Creating a Work Order from a Process ........ Starting a Job ..... Creating an ArchestrA Workflow Software Form ....................................... Publishing the Form ....................................................... Creating an ArchestrA Workflow Software Form .... Testing the Workflow .................................................. Testing the Workflow ....................................... Sample Test Data and Expected Results ................... Linking the Workflow Variables to Form Controls ........ Creating the Workflow .....................................................

........................................... Testing the Workflow ............................... Linking the Workflow Variables to Form Controls ........................................................................................Contents7 Adding Production to a Job ........................... Publishing the Form ............ 83 83 83 84 84 84 86 86 86 Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow ...................................................................................................................................................... 90 Creating the Workflow ........................... 97 Verifying the Data ......... Binding the Form to the Workflow .......................................................... 91 Starting the Workflow ....................................................................................................... 90 Creating the MES Event ....................................................................... 100 Appendix A Potential Issues and Resolutions ......................................................................... 107 Guide to Using ArchestrA Workflow with Wonderware MES .................................................. Asynchronous Methods in the MES Stateless API Libraries ................................. Regional Settings .............. 98 Creating the Workflow ............ Adding a Variable for the DateTime Input ................................................. MES Quality Modules ...... 98 Creating the MES Event ......................... Sample Test Data and Expected Results ................................................. 101 105 105 105 106 106 Index................................................................... 101 DateTime ........................................... Class Arrays in the List of Parameters ............ 99 Starting the Workflow ................................................................................................................... 100 Sample Test Data and Expected Results .................. 97 Sample Test Data and Expected Results ......................................................................... 98 Creating a Work Order from a Process ............................................ 99 Verifying the Data .......................... Creating the Workflow ................................................... Creating an ArchestrA Workflow Software Form ................................................. Intermittent Failures on Reporting Status .......... 89 Adding an Item Class ................................................

8 Contents Guide to Using ArchestrA Workflow with Wonderware MES .

All items listed on this menu are available as items on the main menus. by using the print feature in Adobe Acrobat Reader. Guide to Using ArchestrA Workflow with Wonderware MES . The items listed on this menu change. you can also right-click to open a menu. This guide assumes you know how to use Microsoft Windows. depending on where you are in the product.Workflow Connector application. You can use these tests to gain an understanding of how to set up and use the MES .Workflow Connector to test the communication between the workflows and Wonderware MES Middleware.Workflow Connector v1. In some areas of the MES . and moving objects on the screen. see the Microsoft Online Help. This document applies to the following software versions: • Wonderware MES 2012 • ArchestrA Workflow Software’s MES . in part or whole.Workflow Connector to transfer data between an ArchestrA Workflow Software workflow and the Wonderware MES database and activities via the MES Middleware.9 Welcome This document describes generic ArchestrA Workflow Software workflows that use the ArchestrA Workflow Software’s MES . If you need help with these tasks. The document also includes an appendix that describes how to resolve issues that could occur when running the test workflows.6 You can view this document online or you can print it. including navigating menus. moving from application to application.

Before you contact Technical Support. • If known. have the following information ready: • The type and version of the operating system you are using. • The exact wording of the error messages you saw. commands. • Details of what you did to try to solve the problem(s) and your results. Technical Support Wonderware Technical Support offers a variety of support options to answer any questions on Wonderware products and their implementation. Wonderware MES Client User’s Guide . the Wonderware Technical Support case number assigned to your problem. If you need to contact technical support for help. • Details of how to recreate the problem. and dialog box options. Menus. Code samples and display text.10  Documentation Conventions This documentation uses the following conventions: Convention Used for Initial Capitals Bold Monospace Paths and file names. dialog box names. • Any relevant output listing from the Log Viewer or any other diagnostic applications. refer to the relevant section(s) in this documentation for a possible solution to the problem. if this is an ongoing problem.

For example. Prerequisites for Performing the Tests The following prerequisites are required before the tests can be performed: • MES Client and the MES database are installed. or you can populate the database with data of your own choice.Workflow Connector User Guide. • You can start with a new MES database or with a pre-populated database to test the workflow–MES integration. refer to the ArchestrA Workflow Software MES .Workflow Connector package is installed.Workflow Connector. • ArchestrA Workflow Software and MES . a reliable data script can be used to populate the MES database. • The test procedures provided here assume that the user has some knowledge about MES software and ArchestrA Workflow Software.11 Chapter 1 Getting Started The MES .Workflow Connector provides an integration layer to make connections between ArchestrA Workflow Software workflows and Wonderware MES Middleware. For a complete description of the MES . Guide to Using ArchestrA Workflow with Wonderware MES .

com/System Platform User Guide/ index. Click MES Users. Click Enterprise Console on the Favorites tab. Refer to the MES Client User’s Guide and the ArchestrA Workflow Software Administrator Guide for details.12  Chapter 1 Getting Started Initial Setup Configuring MES and ArchestrA Workflow Software Users Users must be configured in MES and ArchestrA Workflow Software. Logging in to ArchestrA Workflow Software’s Enterprise Console To log in to ArchestrA Workflow Software’s Enterprise Console 1 2 3 4 Launch Internet Explorer.Workflow Connector Refer to the web site below to configure the MES . Guide to Using ArchestrA Workflow with Wonderware MES . and configure the repository in ArchestrA Workflow Software.skelta.html?ConfiguringTheMiddleware Configuring the ArchestrA Workflow Software Repository Database Create an ArchestrA Workflow Software Repository database. Login using the user name and password configured in the MES database.Workflow Connector: http://sun. Configuring MES .

Job.Add stateless API method. which adds an attribute Note: Other stateless API methods can also be used to verify this functionality.13 Chapter 2 Verifying Datatype Compatibility The following stateless MES API methods can be used from the MES .Add. The following datatypes used in the job table are tested using the workflow forms to supply the job information to add a new job in the database: • tfloat • int32 • logical • notes • string20 • string40 Guide to Using ArchestrA Workflow with Wonderware MES .Attr. Adding a Job This test procedure calls the Prod.Add.Workflow Connector: • Prod. which adds a job • Core.Workflow Connector to verify that the datatypes used in MES are compatible with the datatypes used in the MES .Job.

The Workflow Options window appears. A New Workflow window appears..14  Chapter 2 Verifying Datatype Compatibility • string80 • string254 • string1700 • tdatetime Creating the Workflow To create a workflow for the Add a Job test procedure 1 2 3 From Internet Explorer. click Workflows. click the Workflow icon. log in to the Enterprise Console as an MES user. Guide to Using ArchestrA Workflow with Wonderware MES . Job. The option on the workflow tasks defaults to Design the workflow now. The Workflows window appears. On the Ribbon.Add). On the Enterprise Console menu. and then click Save and Continue. 4 Type the title (e.g.

click Engine Activities. It includes a Start activity by default. 8 9 On the Activities menu. Guide to Using ArchestrA Workflow with Wonderware MES . click MES. A workflow window appears. Click and drag the Update Variable activity onto the window to the right of the Start activity.Adding a Job15 5 6 7 Click Finish. In the Activities list. Click and drag the MESXMLCommand activity onto the window to the right of the UpdateVariable activity.

The Generate Command window appears. 15 In the Unique Environment Name list. 12 Right-click the link between the UpdateVariable1 and MESXMLCommand1 activities and click Updated. select the Middleware connection (for example. mes40). Guide to Using ArchestrA Workflow with Wonderware MES . select it. 13 Right-click the MESXMLCommand1 activity and click Activity Properties. 17 In the Stateless API/SP Reference box.Add until that entry appears in the list. 16 In the Middleware Connection list. 11 Create another link from the UpdateVariable1 activity to the MESXMLCommand1 activity.16  Chapter 2 Verifying Datatype Compatibility 10 On the tool bar. begin typing Prod. 18 Select the Generate Input XML Variable check box and type job_input in the box. MESDB_MES). select the environment (for example. click the Generate Command box button. click the Link icon and create a link from the Start activity to the UpdateVariable1 activity.Job. 14 In the Configuration section of the Activity Properties pane. and then press the ENTER key.

21 At the bottom of the Activity Properties pane. 20 Click the Generate Input/Output XML Variable(s) button.Adding a Job17 19 Select the Generate Output XML Variable check box and type job_output in the box. click Save and close the workflow window. Guide to Using ArchestrA Workflow with Wonderware MES .

Job.18  Chapter 2 Verifying Datatype Compatibility Creating an ArchestrA Workflow Software Form To create a form in ArchestrA Workflow Software for the Add a Job procedure 1 On the Enterprise Console menu.Add). 2 On the Ribbon. Guide to Using ArchestrA Workflow with Wonderware MES . A New Form window appears. type a title for the form (for example. You are prompted to select a forms task. click Form. and then click Manage Forms. and click Save & Continue. point to Tools. 3 In the Title box. The Manage Forms window appears.

5 Perform the following steps to add each of the controls and set their properties.Add form listed. a On the tool bar. see the table that follows these steps. On the Basic tab. click Add New. The Forms Designer window appears with the Job. select the control type and then click Next.Adding a Job19 4 Select the Design this form option and click Finish. b c In the radio button list. For a list of the controls and their properties. Guide to Using ArchestrA Workflow with Wonderware MES . enter the control’s properties as specified in the table. The control’s properties window appears. A prompt to select the control type appears.

The control is added to the form. click Save. Control Type TextInput TextInput TextInput DateInput Number Number Number Number Boolean Tag Name Work Order ID Operation ID Sequence Number Required Finish Time Initial Sched Entity ID Target Sched Entity ID Quantity Required Quantity At Start Rework Mapped XML Node wo_id oper_id seq_no req_finish_time_local init_sched_ent_id target_sched_ent_id qty_reqd qty_at_start rework Mandatory Y Y Y Y Y Y Y Y N Other Parameters Decimal Places: 12 Decimal Places: 12 Guide to Using ArchestrA Workflow with Wonderware MES .20  Chapter 2 Verifying Datatype Compatibility Note: The control properties included in the Basic tab can vary based on the control type. d When you have finished entering the control’s properties.

Binding the Form to the Workflow To bind the form to the workflow 1 2 3 On the Enterprise Console menu. The Bind window appears. and then click Manage Forms. select Bind to an existing workflow. click Associate. 4 For the Select Task option. point to Tools. On the Ribbon. click the Finish button at the bottom right of the Forms Designer window. Two list boxes appear to the right of the option.Adding a Job21 Control Type TextInput TextInput TextInput Number Tag Name Spare1 Last Edit Comment Item Estimated Production Rate Mapped XML Node spare1 last_edit_comment item_id est_prod_rate Mandatory Y Y Y Y Other Parameters Decimal Places: 12 6 When you have finished adding all of the controls. Guide to Using ArchestrA Workflow with Wonderware MES .Add form. Select the Job.

click Latest.22  Chapter 2 Verifying Datatype Compatibility 5 In the first list. On the Ribbon.Add). The Workflow Options window appears.Add). 10 Click Save & Continue. The Edit Form window appears. Select the appropriate workflow (that is. click Workflows. Job. The Job.Add workflow window appears. In the second list. 6 7 8 9 Click Save and then click Close to close the window. On the Enterprise Console menu. 11 Select the Design the Workflow now check box and then click Finish to close the window. click the workflow name (that is. Guide to Using ArchestrA Workflow with Wonderware MES . click Edit. Job. for the Add a Job procedure.

In the Workflow Variables box. Guide to Using ArchestrA Workflow with Wonderware MES . enter reqfinishtimevar.Adding a Job23 Adding a Variable for the DateTime Input Because of a difference in how ArchestrA Workflow Software and MES stateless API methods treat DateTime inputs. In the Type list. In the Activity Properties pane. The Update Variable window appears. To add the reqfinishtimevar variable to the Start activity 1 With the Job. The Variables window appears. right-click the Start activity and click Activity Properties.Add workflow opened. click the Variables box button. The Activity Properties pane appears. 2 3 4 5 6 Click Update to save the entries and close the window. This test procedure includes a required finish time input in the workflow form. For additional information about this issue. On the Activity Properties pane. the DateTime variable called reqfinishtimevar will be added to the Start activity. refer to "DateTime" on page 101. click date. click the Initialize box button. To address the DateTime issue for this input. you must create a DateTime variable to convert any DateTime input values from the workflow form from UTC time to local time.

Guide to Using ArchestrA Workflow with Wonderware MES .24  Chapter 2 Verifying Datatype Compatibility 7 8 In the Condition column. A row for the reqfinishtimevar variable is added to the table in the Update Variable window.reqfinishtimevar entry. A list box appears in the Value column. 10 Click the list box button. A navigation tree appears. and SKRootDefinition branches. 12 In the navigation tree. Expand the Variables branch and click the Variable. XmlVariables. 11 Click the Build Expression link. SFFormData. The Variable Editor window appears. 9 Click the Tree icon under the Actions column. A navigation tree appears. hover the pointer over Select and click the list box that appears. expand the Workflow Instance.

req_finish_time_local. The XML variables object is added to the Editor pane. System. SKRootDefinition.InvariantCulture).SFFormData.Globalization.ToDateTime(XmlVariables.CultureInfo. ToLocalTime() Guide to Using ArchestrA Workflow with Wonderware MES . 14 Complete the entry in the Editor pane so that the full entry is as follows: Convert.Adding a Job25 13 Click and drag the entry req_finish_time_local to the Editor pane.

2 Perform the following steps to link each variable to its corresponding form control. click the Set Variable box button. Linking the Workflow Variables to Form Controls To link the workflow variables to their corresponding form controls 1 In the workflow window. 16 Click the OK to close the Update Variable window. 17 Click the Save button at the bottom of the Activity Properties pane to save the reqfinishtimevar variable. Guide to Using ArchestrA Workflow with Wonderware MES . The Update Variable window appears. The completed reqfinishtimevar variable definition appears in the Update Variable window. For a list of the workflow variable-to-form control link mapping. right-click the UpdateVariable1 activity and click Activity Properties. see the table that follows these steps. In the Activity Properties pane. The Activity Properties pane appears.26  Chapter 2 Verifying Datatype Compatibility 15 Click OK and then click Close to close the Variable Editor window.

Adding a Job27

a

In the Condition column, hover the pointer over Select and click the list box that appears. A navigation tree appears.

-

b

Drill down to the variable to be linked and click it. The variable is added to the Condition column.

c

In the Value column, hover the pointer over Enter value and click the text box that appears.

Guide to Using ArchestrA Workflow with Wonderware MES

28  Chapter 2 Verifying Datatype Compatibility

d

In the text box, enter the name of the corresponding form control.

See to the table below for a list of the Job.Add form control names.
Variable
XmlVariables…request.job.wo_id XmlVariables…request.job.oper_id XmlVariables…request.job.seq_no XmlVariables…request.job.req_finish_time_local XmlVariables…request.job.init_sched_ent_id XmlVariables…request.job.target_sched_ent_id XmlVariables…request.job.qty_reqd XmlVariables…request.job.qty_at_start XmlVariables…request.job.rework XmlVariables…request.job.spare1 XmlVariables…request.job.last_edit_comment XmlVariables…request.job.item_id XmlVariables…request.job.est_prod_rate

Form Control Name
SKFormData.SKRootDefinition.wo_id SKFormData.SKRootDefinition.oper_id SKFormData.SKRootDefinition.seq_no Variable.reqfinishtimevar* SKFormData.SKRootDefinition.init_sched_ent_id SKFormData.SKRootDefinition.target_sched_ent_id SKFormData.SKRootDefinition.qty_reqd SKFormData.SKRootDefinition.qty_at_start SKFormData.SKRootDefinition.rework SKFormData.SKRootDefinition.spare1 SKFormData.SKRootDefinition.last_edit_comment SKFormData.SKRootDefinition.item_id SKFormData.SKRootDefinition.est_prod_rate

* DateTimes are set to workflow variables created to ensure that they are sent as localtime to the MES database.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding a Job29

The list of all of the Job.Add links is shown in the following figure.

3 4 5

When all of the workflow variable-to-form control links have been entered, click the OK button to close the Update Variable window. Click the Save button at the bottom of the Activity Properties pane to save the links. Close the workflow window.

Guide to Using ArchestrA Workflow with Wonderware MES

Add workflow and click Publish.30  Chapter 2 Verifying Datatype Compatibility 6 In the Workflows window. right-click the Job. A message appears indicating the status of the publish operation. Guide to Using ArchestrA Workflow with Wonderware MES . 7 Click Close to close the message.

Right-click the Job. point to Tools.Add form and click Publish. Guide to Using ArchestrA Workflow with Wonderware MES .Adding a Job31 Publishing the Form To publish the form 1 2 On the Enterprise Console menu. and then click Manage Forms. 3 Click Close to close the message. The Manage Forms window appears. A message appears indicating the status of the publish operation.

Add form entry. The Job. click Fill Form. A list of available forms appears. To test the workflow 1 On the Enterprise Console menu. Guide to Using ArchestrA Workflow with Wonderware MES .Add form appears. you can test the procedure by completing the form and then checking to see if the data was entered correctly in the MES database.32  Chapter 2 Verifying Datatype Compatibility Testing the Workflow Now that the form has been created. 2 Click the Job.

Click OK to close the message. A message appears indicating the status of the form submission. Control Name Database Data Type Data Input Data Expected in MES Database Wo_ID Oper_Id Seq_No Req_Finish_Time_Local Init_Sched_Ent_Id Target_Sched_Ent_Id String80 String80 Int32 TDatetime Int32 Int32 Wo1 Oper1 12345 10/26/2012 15:16:17 15 15 Wo1 Oper1 12345 10/26/2012 15:16:17 15 15 Guide to Using ArchestrA Workflow with Wonderware MES . are listed in the following tables. Sample Test Data and Expected Results Two sets of sample test data that could be entered in the form. 4 5 6 When the form is completed. Verify that the test data was correctly entered in the MES database. and the expected results in the MES database. click Finish.Adding a Job33 3 Complete the form with test data.

12345 1234567890123.12345 1234567890123.987654 Wo1 Oper2 12345 10/29/2012 18:19:20 15 15 987654321.987654 True Test Spare1 Test Last Edit Comment QA-Case24 987654321.987654 987654321.12 1234567890123.987654 987654321.987654 Yes (True) Test Spare1 Test Last Edit Comment QA-Case24 987654321.987654 Guide to Using ArchestrA Workflow with Wonderware MES .12 False Test Spare1 Test Last Edit Comment QA-Case24 1234567890123.12 Column Name Database Data Type Data Input Data Expected in MES Database Wo_ID Oper_Id Seq_No Req_Finish_Time_Local Init_Sched_Ent_Id Target_Sched_Ent_Id Qty_Reqd Qty_At_Start Rework Spare1 Last_Edit_Comment Item Est_Prod_Rate String80 String80 Int32 TDatetime Int32 Int32 TFloat TFloat Logical String80 String254 String80 TFloat Wo1 Oper2 12345 10/29/2012 18:19:20 15 15 987654321.34  Chapter 2 Verifying Datatype Compatibility Control Name Database Data Type Data Input Data Expected in MES Database Qty_Reqd Qty_At_Start Rework Spare1 Last_Edit_Comment Item Est_Prod_Rate TFloat TFloat Logical String80 String254 String80 TFloat 1234567890123.12345 No (False) Test Spare1 Test Last Edit Comment QA-Case24 1234567890123.

Adding an Attribute35 Adding an Attribute This test procedure calls the Core. use attr_output Creating an ArchestrA Workflow Software Form Perform the procedure in "Creating an ArchestrA Workflow Software Form" on page 18.Add. with the following exceptions: • For the workflow title. use Attr. • Specify the following controls for the form: Control Type Boolean Number Tag Name Predefined Data Type Mapped XML Node predefined data_type Mandatory Other Parameters Y Decimal Places: 0 Min Value: 0 Max Value: 12 TextInput Attribute Description attr_desc Y Guide to Using ArchestrA Workflow with Wonderware MES . use attr_input • For the Generate Output XML Variable. use Core. • In the Generate Command window: • For the stateless API. Creating the Workflow Perform the procedure in "Creating the Workflow" on page 14.Add stateless API method. use Attr.Attr.Add.Add • For the Generate Input XML Variable. with exceptions as noted in the following topics. with the following exceptions: • For the form title. The following datatypes used in the ent table are tested using the workflow forms to supply the attribute information to add a new attribute in the database: • int32 • logical • string80 • string254 • tdatetime The process for creating the Add an Attribute test procedure is the same as that described in "Adding a Job" on page 13.Attr.

with the following exceptions: • Link the following workflow variables to their corresponding form controls: Variable Form Control Name XmlVariables…request.SKRootDefinition. Testing the Workflow Perform the procedure in "Testing the Workflow" on page 32. attr.last_edit_at SKFormData. attr.data_type XmlVariables…request. Linking the Workflow Variables to Form Controls Perform the procedure in "Linking the Workflow Variables to Form Controls" on page 26.SKRootDefinition.SKRootDefinition.attr. attr.attr_desc SKFormData.SKRootDefinition.attr_grp XmlVariables…request.filtr XmlVariables…response.attr_grp SKFormData.SKRootDefinition.predefined SKFormData.attr_desc XmlVariables…request.attr_id XmlVariables…response.datatype SKFormData.SKRootDefinition. attr.filtr SKFormData.attr_id SKFormData.last_edit_at Publishing the Form Perform the procedure in "Publishing the Form" on page 31. Guide to Using ArchestrA Workflow with Wonderware MES .predefined XmlVariables…request.SKRootDefinition.36  Chapter 2 Verifying Datatype Compatibility Control Type Number Tag Name Attribute Group Mapped XML Node attr_group Mandatory Y Other Parameters Decimal Places: 0 Min Value: 0 Max Value: 11 TextInput TextInput TextInput Filter Attribute ID Last Edit At filtr attr_id last_edit_at Y N Y Decimal Places: 12 Binding the Form to the Workflow Perform the procedure in "Binding the Form to the Workflow" on page 21.

Adding an Attribute37 Sample Test Data and Expected Results Sample test data that could be entered in the form. Column Name Database Data Type Data Input Data Expected in MES Database Predefined Data_Type Attr_Desc Attr_Grp Filtr Logical Int32 String80 Int32 String254 True 4 Test Attribute 7 Test Filter True 4 Test Attribute 7 Test Filter Guide to Using ArchestrA Workflow with Wonderware MES . and the expected results in the MES database. are listed in the following table.

38  Chapter 2 Verifying Datatype Compatibility Guide to Using ArchestrA Workflow with Wonderware MES .

and when calling API methods with a larger number of parameters of different datatypes that affect multiple tables in the database: • Prod. which starts a job • Prod.39 Chapter 3 Verifying Minimum and Maximum Data The following stateless API methods can be used from the MES .ItemClass.AddProd.JobExec.JobExec.JobExec.StartJob. Guide to Using ArchestrA Workflow with Wonderware MES . which adds an item class • Prod.Workflow Connector to verify that data is passed correctly from the workflow to the MES database when calling API methods with only a few number of parameters that affects only one table in the MES database.Add. which adds production to a job Note: Other stateless API methods can also be used to verify this functionality. which creates a work order from a process • Prod.CreateWoFromProcess.

use Prod. use ItemClass.40  Chapter 3 Verifying Minimum and Maximum Data Adding an Item Class This test procedure calls the Prod. with exceptions as noted in the following topics. use ItemClass.Add stateless API method to verify that a few parameters that affect only one database table can be passed correctly from the MES . • Specify the following controls for the form: Control Type TextInput TextInput Boolean Boolean Boolean Boolean Boolean Tag Name New Item Class Item Class Description Produced Consumed Obsolete Purchased Sold Mapped XML Node item_class_id item_class_desc produced consumed obsolete purchased sold Mandatory Y Y Other Parameters Label Position: Top Label Position: Top Label Position: Top Label Position: Top Label Position: Top Guide to Using ArchestrA Workflow with Wonderware MES . with the following exceptions: • For the workflow title. use itemclass_output Creating an ArchestrA Workflow Software Form Perform the procedure in "Creating an ArchestrA Workflow Software Form" on page 18. • In the Generate Command window: • For the stateless API. Creating the Workflow Perform the procedure in "Creating the Workflow" on page 14. use itemclass_input • For the Generate Output XML Variable.Add • For the Generate Input XML Variable.Workflow Connector and be recorded in the MES database.ItemClass. The process for creating the Add an Item Class test procedure is the same as that described in "Adding a Job" on page 13.ItemClass.Add.Add. with the following exceptions: • For the form title.

item_class_input.request.item_class_id SKFormData.request.sold Publishing the Form Perform the procedure in "Publishing the Form" on page 31 to publish the ItemClass.Add workflow. purchased XMLVariables.SKRootDefinition.item_class_desc SKFormData.Add form.item_class_input.request.SKRootDefinition.SKRootDefinition.Adding an Item Class41 Binding the Form to the Workflow Perform the procedure in "Binding the Form to the Workflow" on page 21 to bind the ItemClass. Variable Form Control Name XMLVariables.produced SKFormData.Add form to the ItemClass.Add workflow.request.item_class_input.request.purchased SKFormData.SKRootDefinition.Add form controls. Linking the Workflow Variables to Form Controls Perform the procedure in "Linking the Workflow Variables to Form Controls" on page 26 to link the ItemClass.item_class_input. Testing the Workflow Perform the procedure in "Testing the Workflow" on page 32 to test the ItemClass.Add workflow variables to the ItemClass. as listed in the following table. item_class_desc XMLVariables. obsolete XMLVariables.obsolete SKFormData.item_class_input.consumed SKFormData.SKRootDefinition. consumed XMLVariables. produced XMLVariables.request.SKRootDefinition.item_class_input.SKRootDefinition. Guide to Using ArchestrA Workflow with Wonderware MES . sold SKFormData.request.item_class_input. item_class_id XMLVariables.

Workflow Connector and be recorded in the MES database.JobExec.CWFP. and the expected results in the MES database. with exceptions as noted in the following topics.CreateWoFromProcess • For the Generate Input XML Variable. use JobExec. The process for creating the Create a Work Order from a Process test procedure is the same as that described in "Adding a Job" on page 13. are listed in the following table. • In the Generate Command window: • For the stateless API. use JobExec.CreateWoFromProcess stateless API method to verify that a large number of parameters of different datatypes that affect multiple database tables can be passed correctly from the MES . with the following exceptions: • For the workflow title.42  Chapter 3 Verifying Minimum and Maximum Data Sample Test Data and Expected Results Sample test data that could be entered in the form. use cwfp_input • For the Generate Output XML Variable. use cwfp_output Guide to Using ArchestrA Workflow with Wonderware MES . Creating the Workflow Perform the procedure in "Creating the Workflow" on page 14. Column Name Database Data Type Data Input Data Expected in MES Database ItemClass Id Item Class Desc Produced Consumed Obsolete Purchased Sold String80 String80 Logical Logical Logical Logical Logical TestItemClass TestItemClass Yes (True) Yes (True) No (False) No (False) No (False) TestItemClass TestItemClass True True False False False Creating a Work Order from a Process This test procedure calls the Prod.

click Next Cancel cancel Button Type: Cancel Text: Cancel Is Form Level Button: Yes Binding the Form to the Workflow Perform the procedure in "Binding the Form to the Workflow" on page 21 to bind the JobExec.CWFP form to the JobExec. Guide to Using ArchestrA Workflow with Wonderware MES .CWFP workflow.Creating a Work Order from a Process43 Creating an ArchestrA Workflow Software Form Perform the procedure in "Creating an ArchestrA Workflow Software Form" on page 18. • Specify the following controls for the form: Control Type TextInput or Lookup TextInput or Lookup TextInput or Lookup TextInput TextInput TextInput or Lookup TextInput or Lookup DateInput DateInput Number Number Number Button. use JobExec.CWFP. click Next Tag Name Create Work Order for Product Use Production Process Product Specification Work Order ID Description User Name BOM Version Release Date/Time Due Date/Time Required Quantity Start Quantity Priority OK Mapped XML Node item_id process_id spec_ver_id wo_id wo_desc user_id bom_ver_id release_time req_finish_time req_qty start_qty priority ok Mandatory Y Y N Y N N N Y Y Y Y N Other Parameters Minimum Value: 0 Minimum Value: 0 Button Type: Submit Text: OK Is Form Level Button: Yes Button. with the following exceptions: • For the form title.

InvariantCulture) .wo_desc * DateTimes are set to workflow variables created to ensure that they are sent as localtime to the MES database. For additional information about this issue. Guide to Using ArchestrA Workflow with Wonderware MES .process_id SKFormData.req_finish_time. Variable Form Control Name XMLVariables.SKRootDefinition.Globalization.InvariantCulture) .cwfp_input. wo_id XMLVariables. System.cwfp_input. wo_desc SKFormData.SKRootDefinition.request. spec_ver_id XMLVariables.spec_ver_id SKFormData. process_id XMLVariables. refer to "DateTime" on page 101.ToLocalTime() • The variable Due DateTime Local of type date and with the expression: Convert.request.cwfp_input. System. perform the procedure in "Adding a Variable for the DateTime Input" on page 23 to add the following variables: • The variable Release DateTime Local of type date and with the expression: Convert. To address the DateTime issue for these inputs.request.SKRootDefinition.ToLocalTime() Linking the Workflow Variables to Form Controls Perform the procedure in "Linking the Workflow Variables to Form Controls" on page 26 to link the JobExec.ToDateTime (XmlVariables.SFFormData.request.44  Chapter 3 Verifying Minimum and Maximum Data Adding Variables for the DateTime Inputs Because of a difference in how ArchestrA Workflow Software and MES stateless API methods treat DateTime inputs.wo_id SKFormData.release_time.Globalization.request.ToDateTime (XmlVariables.cwfp_input.SKRootDefinition. you must create a DateTime variable to convert any DateTime input values from the workflow form from UTC time to local time.SKRootDefinition.item_id SKFormData. This test procedure includes Release Date/Time and Due Date/Time inputs in the workflow form.CWFP workflow variables to the JobExec.CultureInfo.SKRootDefinition.SFFormData.SKRootDefinition.CultureInfo. as listed in the following table. item_id XMLVariables.cwfp_input.CWFP form controls.

req_qty SKFormData.request. req_qty XMLVariables. release_time_local XMLVariables.request.cwfp_input.bom_ver_id Variables.request.Due DateTime Local* SKFormData.SKRootDefinition. Column Name Database Data Type Data Input Data Expected in MES Database Item Id Process Id Spec Version Id Work Order Id Work Order Description String80 String80 String 80 String 80 String80 Item-A Process_001 NULL TestWO Work_Order_TestWO Item-A Process_001 NULL TestWO Work_Order_TestWO Guide to Using ArchestrA Workflow with Wonderware MES . wo_priority SKFormData.request.SKRootDefinition. Publishing the Form Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec.request.Creating a Work Order from a Process45 Variable Form Control Name XMLVariables.cwfp_input.start_qty SKFormData.Release DateTime Local* Variables. Testing the Workflow Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec. and the expected results in the MES database.request.cwfp_input. are listed in the following table.request.CWFP workflow.cwfp_input.SKRootDefinition.CWFP form.cwfp_input.priority * DateTimes are set to workflow variables created to ensure that they are sent as localtime to the MES database.cwfp_input.user_id SKFormData. user_id XMLVariables.SKRootDefinition. bom_ver_id XMLVariables. start_qty XMLVariables. Sample Test Data and Expected Results Sample test data that could be entered in the form.cwfp_input. req_finish_time_local XMLVariables.SKRootDefinition.

StartJob stateless API method to verify that a large number of parameters of different datatypes that affect multiple database tables can be passed correctly from the MES . with exceptions as noted in the following topics. use JobExec.StartJob.Workflow Connector and be recorded in the MES database. Creating the Workflow Perform the procedure in "Creating the Workflow" on page 14. • In the Generate Command window: • For the stateless API. use startjob_output Creating an ArchestrA Workflow Software Form Perform the procedure in "Creating an ArchestrA Workflow Software Form" on page 18.1 11/01/2012 04:00:00 11/16/2012 14:00:00 40 50 2 Ww V. with the following exceptions: • For the workflow title. Guide to Using ArchestrA Workflow with Wonderware MES . use Prod. use JobExec. The process for creating the Start a Job test procedure is the same as that described in "Adding a Job" on page 13.1 11/01/2012 04:00:00 11/16/2012 14:00:00 40 50 2 Starting a Job This test procedure calls the Prod.A.JobExec. use startjob_input • For the Generate Output XML Variable.JobExec.46  Chapter 3 Verifying Minimum and Maximum Data Column Name Database Data Type Data Input Data Expected in MES Database User Id BOM Version Id Release Time Local Required Finish Time Local Required Quantity Start Quantity Priority String 80 String80 DateTime DateTIme Int32 Int32 Int32 Ww V.A.StartJob.StartJob • For the Generate Input XML Variable. with the following exceptions: • For the form title.

For additional information about this issue.event_time.InvariantCulture) .StartJob form to the JobExec.CultureInfo.ToDateTime (XmlVariables.ToLocalTime() Guide to Using ArchestrA Workflow with Wonderware MES . System. This test procedure includes an Event Time input in the workflow form.Starting a Job47 • Specify the following controls for the form: Control Type Number or Lookup TextInput or Lookup TextInput TextInput Number Number TextInput Boolean Boolean DateInput Tag Name Entity ID User Name Work Order ID Operation ID Sequence Number Job Position Status Notes Check Privileges Check Certifications Event Time Mapped XML Node ent_id user_id wo_id op_id seq_no job_pos status_notes check_privs check_certs event_time Mandatory Y Y Y Y Y N N Y Y N Other Parameters Minimum: 0 Minimum: 0 Minimum: 0 Mode of Text: Multiple Binding the Form to the Workflow Perform the procedure in "Binding the Form to the Workflow" on page 21 to bind the JobExec.SFFormData. refer to "DateTime" on page 101.SKRootDefinition.Globalization. perform the procedure in "Adding a Variable for the DateTime Input" on page 23 to add the following variable: • The variable Event DateTime Local of type date and with the expression: Convert. you must create a DateTime variable to convert any DateTime input values from the workflow form from UTC time to local time. To address the DateTime issue for this input. Adding a Variable for the DateTime Input Because of a difference in how ArchestrA Workflow Software and MES stateless API methods treat DateTime inputs.StartJob workflow.

request.StartJob form.Event DateTIme Local* *DateTime is set to workflow variable created to ensure that it is sent as localtime to the MES database.oper_id SKFormData. ent_id XMLVariables.cwfp_input.request.ent_id SKFormData.user_id SKFormData.cwfp_input.SKRootDefinition. as listed in the following table.48  Chapter 3 Verifying Minimum and Maximum Data Linking the Workflow Variables to Form Controls Perform the procedure in "Linking the Workflow Variables to Form Controls" on page 26 to link the JobExec.cwfp_input.status_notes SKFormData.cwfp_input.cwfp_input. Testing the Workflow Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.request. Variable Form Control Name XMLVariables.cwfp_input.SKRootDefinition.SKRootDefinition.check_privs SKFormData.request.request.SKRootDefinition.check_certs Variables. oper_id XMLVariables.seq_no SKFormData. check_certs XMLVariables.SKRootDefinition.cwfp_input.cwfp_input.request. event_time_local SKFormData.request.SKRootDefinition.SKRootDefinition.wo_id SKFormData. user_id XMLVariables. status_notes XMLVariables. wo_id XMLVariables.cwfp_input.request.request.SKRootDefinition. Publishing the Form Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec. job_pos XMLVariables.StartJob workflow.cwfp_input.job_pos SKFormData. Guide to Using ArchestrA Workflow with Wonderware MES .StartJob workflow variables to the JobExec.StartJob form controls.SKRootDefinition.request. check_privs XMLVariables. seq_no XMLVariables.

AddProd • For the Generate Input XML Variable. use addprod_input • For the Generate Output XML Variable.Workflow Connector and be recorded in the MES database. and the expected results in the MES database.JobExec. with the following exceptions: • For the workflow title. are listed in the following table. with exceptions as noted in the following topics. The process for creating the Add Production to a Job test procedure is the same as that described in "Adding a Job" on page 13. • In the Generate Command window: • For the stateless API.AddProd. use Prod. Column Name Database Data Type Data Input Data Expected in MES Database Ent Id User Id Work Order Id Operation Id Sequence No Job Position Status Notes Check Privileges Check Certifications Event Time Int32 String 80 String 80 String80 Int32 Int32 String256 Logical Logical datetime 4 ww TestWO OP-001 0 0 Testing start job Yes (True) No (False) 11/08/2012 5:00:00 4 ww TestWO OP-001 0 0 Testing start job True False 11/08/2012 5:00:00 Adding Production to a Job This test procedure calls the Prod. use JobExec. use addprod_output Guide to Using ArchestrA Workflow with Wonderware MES .Adding Production to a Job49 Sample Test Data and Expected Results Sample test data that could be entered in the form.AddProd stateless API method to verify that a large number of parameters of different datatypes that affect multiple database tables can be passed correctly from the MES .JobExec. Creating the Workflow Perform the procedure in "Creating the Workflow" on page 14.

AddProd workflow. For additional information about this issue. Adding a Variable for the DateTime Input Because of a difference in how ArchestrA Workflow Software and MES stateless API methods treat DateTime inputs.50  Chapter 3 Verifying Minimum and Maximum Data Creating an ArchestrA Workflow Software Form Perform the procedure in "Creating an ArchestrA Workflow Software Form" on page 18. you must create a DateTime variable to convert any DateTime input values from the workflow form from UTC time to local time. refer to "DateTime" on page 101. Guide to Using ArchestrA Workflow with Wonderware MES . • Specify the following controls for the form: Control Type Number DateInput TextInput or Lookup Number or Lookup Number Number TextInput TextInput Number or Lookup TextInput or Lookup Number TextInput TextInput Number Tag Name Session ID Event Time User Name Entity ID Qty Produced Reason Code Lot No Sublot No Storage Entity ID Produced Item BOM Position Seqment Requirement ID Seqment Response ID Job Position Mapped XML Node session_id event_time user_id ent_id qty_prod reas_cd lot_no sublot_no to_ent_id item_id bom_pos seg_req_id seg_res_id job_pos Mandatory Y N Y Y Y N N N N N N N N N Other Parameters Minimum: 0 Minimum: 0 Minimum: 0 Minimum: 0 Minimum: 0 Binding the Form to the Workflow Perform the procedure in "Binding the Form to the Workflow" on page 21 to bind the JobExec.AddProd. use JobExec. with the following exceptions: • For the form title.AddProd form to the JobExec.

SKRootDefinition.request.add_prod_input.reas_cd SKFormData.addprod_input.storage_ent_id SKFormData. reas_cd XMLVariables.SKRootDefinition.request. Variable Form Control Name XMLVariables.InvariantCulture) .request.CultureInfo.addprod_input.event_time.session_id Variables.user_id SKFormData.qty_prod SKFormData. item_id SKFormData.addprod_input.request. session_id XMLVariables.ToLocalTime() Linking the Workflow Variables to Form Controls Perform the procedure in "Linking the Workflow Variables to Form Controls" on page 26 to link the JobExec. storage_ent_id XMLVariables.Globalization.SFFormData. System.Adding Production to a Job51 This test procedure includes an Event Time input in the workflow form.request. perform the procedure in "Adding a Variable for the DateTime Input" on page 23 to add the following variable: • The variable Event DateTime Local of type date and with the expression: Convert. qty_prod XMLVariables.request.addprod_input.AddProd workflow variables to the JobExec.request.AddProd form controls.SKRootDefinition.sublot_no SKFormData.SKRootDefinition.SKRootDefinition. event_time_local XMLVariables.SKRootDefinition.SKRootDefinition. as listed in the following table.request. user_id XMLVariables.lot_no SKFormData. lot_no XMLVariables.ent_id SKFormData.addprod_input.addprod_input.addprod_input.SKRootDefinition.addprod_input.request. Guide to Using ArchestrA Workflow with Wonderware MES .item_id *DateTime is set to workflow variable created to insure that it is sent as localtime to the MES database.SKRootDefinition.addprod_input.request.SKRootDefinition.ToDateTime (XmlVariables. ent_id XMLVariables. To address the DateTime issue for this input. sublot_no XMLVariables.Event DateTime Local* SKFormData.

request. bom_pos XMLVariables.bom_pos SKFormData. Sample Test Data and Expected Results Sample test data that could be entered in the form. Column Name Database Data Type Data Input Data Expected in MES Database Session Id Event Time User Id Ent Id Qty Prod Reason Code Lot No Sublot No Storage Ent Id Produced Item Int32 datetime String 80 Int32 Double Int32 String80 String80 Int32 String80 114 11/08/2012 5:00:00 ww 4 4 1 1 Null 4 Item-A 114 11/08/2012 5:00:00 ww 4 4 1 1 Null 4 Item-A Guide to Using ArchestrA Workflow with Wonderware MES .SKRootDefinition.SKRootDefinition.seg_res_id SKFormData.request.seg_req_id SKFormData.request.52  Chapter 3 Verifying Minimum and Maximum Data Variable Form Control Name XMLVariables. job_pos SKFormData.addprod_input. Publishing the Form Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec.SKRootDefinition.addprod_input. and the expected results in the MES database.AddProd workflow.addprod_input.addprod_input.request.job_pos *DateTime is set to workflow variable created to insure that it is sent as localtime to the MES database. seq_res_id XMLVariables. Testing the Workflow Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.AddProd form. are listed in the following table.SKRootDefinition. seg_req_id XMLVariables.

Adding Production to a Job53 Column Name Database Data Type Data Input Data Expected in MES Database Bom Position Segment Requirement ID Segment Response ID Job Position Int32 String80 String80 Int32 Null Null Null 0 Null Null Null 0 Guide to Using ArchestrA Workflow with Wonderware MES .

54  Chapter 3 Verifying Minimum and Maximum Data Guide to Using ArchestrA Workflow with Wonderware MES .

StartJob.Workflow Connector to verify that complex event types used in MES are compatible with the event types used in the MES .55 Chapter 4 Verifying Complex Event Types The following stateless API methods can be used from the MES .SetCurLotData.SetCurLotData in the stateless API to verify that the workflow connector calls the correct overload method to record data in the MES database. Guide to Using ArchestrA Workflow with Wonderware MES .Workflow Connector • JobExec. which adds current lot information to a job • Prod. which starts a job Note: Other stateless API methods can also be used to verify this functionality. The process for creating the Set Current Lot Information for a Job test procedure is the same as that described in "Adding a Job" on page 13. with exceptions as noted in the following topics. Setting the Current Lot Information for a Job This test procedure calls the overloaded method for the JobExec.JobExec.

• In the Generate Command window: • For the stateless API. with the following exceptions: • For the form title.SetCurLotData workflow.56  Chapter 4 Verifying Complex Event Types Creating the Workflow Perform the procedure in "Creating the Workflow" on page 14. use setcurlotdata_input • For the Generate Output XML Variable. • Specify the following controls for the form: Control Type Number Number Number TextInput TextInput TextInput Number Number Boolean Boolean Tag Name Entity ID Job Pos BOM Pos Default Current Item ID Default Current Lot Number Default Current SubLot Number Default Reason Code Current Storage Entity IDs Backflush Update Inventory Mapped XML Node ent_id job_pos bom_pos cur_item_id cur_lot_no cur_sublot_no cur_reas_cd cur_storage_ent_id cur_backflush cur_update_inv Mandatory Y Y Y Y Y Y Y Y Other Parameters Binding the Form to the Workflow Perform the procedure in "Binding the Form to the Workflow" on page 21 to bind the JobExec.SetCurLotData • For the Generate Input XML Variable. use JobExec.SetCurLotData. Guide to Using ArchestrA Workflow with Wonderware MES . with the following exceptions: • For the workflow title.SetCurLotData. use setcurlotdata_output Creating an ArchestrA Workflow Software Form Perform the procedure in "Creating an ArchestrA Workflow Software Form" on page 18. use JobExec. use JobExec.SetCurLotData form to the JobExec.

SKRootDefinition.SetCurLotData form controls.cur_backflush SKFormData.cur_sublot_no SKFormData. bom_pos XmlVariables…request.bom_pos SKFormData.SKRootDefinition.SetCurLotData workflow variables to the JobExec.cur_storage_ent_id XmlVariables…request.SKRootDefinition. Column Name Database Data Type Data Input Data Expected in MES Database Ent_Id Job_Pos Bom_Pos DefaultCurrentLotNo Int32 Int32 Int32 String80 16 0 0 Test Default Current Lot No 16 0 0 Test Default Current Lot No Guide to Using ArchestrA Workflow with Wonderware MES .cur_backflush XmlVariables…request.SetCurLotData workflow.Setting the Current Lot Information for a Job57 Linking the Workflow Variables to Form Controls Perform the procedure in "Linking the Workflow Variables to Form Controls" on page 26 to link the JobExec.cur_reas_cd XmlVariables…request.cur_reas_cd SKFormData.SKRootDefinition.cur_lot_no XmlVariables…request.SKRootDefinition.cur_update_inv Publishing the Form Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec.SKRootDefinition. and the expected results in the MES database. cur_item_id XmlVariables…request. as listed in the following table.cur_sublot_no XmlVariables…request.SetCurLotData form.cur_storage_ent_id SKFormData.SKRootDefinition.ent_id XmlVariables…request. job_pos XmlVariables…request.SKRootDefinition. are listed in the following table.cur_item_id SKFormData. Variable XmlVariables…request.ent_id SKFormData. Sample Test Data and Expected Results Sample test data that could be entered in the form.SKRootDefinition.cur_lot_no SKFormData. Testing the Workflow Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.job_pos SKFormData.cur_update_inv Form Control Name SKFormData.SKRootDefinition.

use startjob_input • For the Generate Output XML Variable.Workflow Connector calls the correct overload method to send data to the MES database. use Prod. use JobExec.58  Chapter 4 Verifying Complex Event Types Column Name Database Data Type Data Input Data Expected in MES Database DefaultCurrentSubLotNo DefaultCurrentItemId DefaultCurrentReasCd CurrentStorageEntId UpdateInventory Backflush String80 String80 Int32 Int32 Logical Logical Test Default Current Sub Lot No QA-Case24 1 4 No (False) No (False) Test Default Current Sub Lot No QA-Case24 1.StartJob. use startjob_output Creating an ArchestrA Workflow Software Form Perform the procedure in "Creating an ArchestrA Workflow Software Form" on page 18. with the following exceptions: • For the form title.StartJob. Creating the Workflow Perform the procedure in "Creating the Workflow" on page 14. Guide to Using ArchestrA Workflow with Wonderware MES .StartJob stateless API method to verify that the MES .StartJob • For the Generate Input XML Variable.12 4 False False Starting a Job This test procedure calls the Prod.JobExec. The process for creating the Start a Job test procedure is the same as that described in "Adding a Job" on page 13.JobExec. with exceptions as noted in the following topics. use JobExec. • In the Generate Command window: • For the stateless API. with the following exceptions: • For the workflow title.

ToDateTime (XmlVariables. perform the procedure in "Adding a Variable for the DateTime Input" on page 23 to add the following variable: • The variable Event DateTime Local of type date and with the expression: Convert.SFFormData.ToLocalTime() Guide to Using ArchestrA Workflow with Wonderware MES . To address the DateTime issue for this input.SKRootDefinition. This test procedure includes an Event Time input in the workflow form.Globalization.event_time.Starting a Job59 • Specify the following controls for the form: Control Type Number or Lookup TextInput or Lookup TextInput TextInput Number Number TextInput Boolean Boolean DateInput Tag Name Entity ID User Name Work Order ID Operation ID Sequence Number Job Position Status Notes Check Privileges Check Certifications Event Time Mapped XML Node ent_id user_id wo_id op_id seq_no job_pos status_notes check_privs check_certs event_time Mandatory Y Y Y Y Y N N Y Y N Other Parameters Minimum: 0 Minimum: 0 Minimum: 0 Mode of Text: Multiple Binding the Form to the Workflow Perform the procedure in "Binding the Form to the Workflow" on page 21 to bind the JobExec. System. refer to "DateTime" on page 101.StartJob workflow.CultureInfo. you must create a DateTime variable to convert any DateTime input values from the workflow form from UTC time to local time. For additional information about this issue. Adding a Variable for the DateTime Input Because of a difference in how ArchestrA Workflow Software and MES stateless API methods treat DateTime inputs.InvariantCulture) .StartJob form to the JobExec.

SKRootDefinition. check_certs XMLVariables.StartJob workflow.job_pos SKFormData.cwfp_input.request.ent_id SKFormData.SKRootDefinition. ent_id XMLVariables. seq_no XMLVariables. as listed in the following table. wo_id XMLVariables. job_pos XMLVariables.wo_id SKFormData.cwfp_input. oper_id XMLVariables.cwfp_input.request. user_id XMLVariables.request.cwfp_input.cwfp_input.StartJob form. event_time_local SKFormData.StartJob form controls.check_certs Variables.SKRootDefinition.cwfp_input.SKRootDefinition. Publishing the Form Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec.SKRootDefinition.user_id SKFormData.cwfp_input.SKRootDefinition.SKRootDefinition. Guide to Using ArchestrA Workflow with Wonderware MES . check_privs XMLVariables.request.status_notes SKFormData.request.cwfp_input. Variable Form Control Name XMLVariables.SKRootDefinition.check_privs SKFormData.oper_id SKFormData.cwfp_input.request.SKRootDefinition.request.request. Testing the Workflow Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.request.requrest.60  Chapter 4 Verifying Complex Event Types Linking the Workflow Variables to Form Controls Perform the procedure in "Linking the Workflow Variables to Form Controls" on page 26 to link the JobExec.StartJob workflow variables to the JobExec.cwfp_input.Event DateTIme Local* *DateTime is set to workflow variable created to ensure that it is sent as localtime to the MES database. status_notes XMLVariables.seq_no SKFormData.

and the expected results in the MES database. Column Name Database Data Type Data Input Data Expected in MES Database Ent Id User Id Work Order Id Operation Id Sequence No Job Position Status Notes Check Privileges Check Certifications Event Time Int32 String 80 String 80 String80 Int32 Int32 String256 Logical Logical datetime 4 ww TestWO OP-001 0 0 Testing start job Yes (True) No (False) 11/08/2012 5:00:00 4 ww TestWO OP-001 0 0 Testing start job True False 11/08/2012 5:00:00 Column Name Database Data Type Data Input Data Expected in MES Database Ent Id User Id Work Order Id Operation Id Sequence No Job Position Status Notes Check Privileges Check Certifications Event Time Int32 String 80 String 80 String80 Int32 Int32 String256 Logical Logical datetime 4 ww TestWO OP-001 0 0 Testing start job Yes (True) No (False) Null 4 ww TestWO OP-001 0 0 Testing start job True False Current date and time Guide to Using ArchestrA Workflow with Wonderware MES .Starting a Job61 Sample Test Data and Expected Results Two sets of sample test data that could be entered in the form. are listed in the following table.

62  Chapter 4 Verifying Complex Event Types Guide to Using ArchestrA Workflow with Wonderware MES .

which creates a work order from a process • Prod.StartJob. • Prod.Workflow Connector to verify that data is sent correctly when the workflow is on a machine with a different regional setting then the machine that the MES Middleware and database are on. set the regional settings to Eastern Time. Prerequisites for Performing the Tests Two machines are necessary for these test processes: • The client machine should have Workflow and MES Client installed.63 Chapter 5 Verifying DateTimes with Different Regional Settings The following stateless API methods can be used from the MES . For this machine.JobExec. • The host machine should have MES Middleware and the MES database installed.JobExec.CreateWoFromProcess. use the Middleware Proxy Configuration Editor to change the Host Proxy to point to the second machine. which starts a job Note: Other stateless API methods can also be used to verify this functionality. Also. Set the regional settings to Pacific Time. Guide to Using ArchestrA Workflow with Wonderware MES .

with the following exceptions: • For the form title. use JobExec.64  Chapter 5 Verifying DateTimes with Different Regional Settings Creating a Work Order from a Process This test procedure calls the Prod.CreateWoFromProcess • For the Generate Input XML Variable. with the following exceptions: • For the workflow title.CWFP. • Specify the following controls for the form: Control Type TextInput or Lookup TextInput or Lookup TextInput or Lookup TextInput TextInput TextInput or Lookup TextInput or Lookup DateInput Tag Name Create Work Order for Product Use Production Process Product Specification Work Order ID Description User Name BOM Version Release Date/Time Mapped XML Node item_id process_id spec_ver_id wo_id wo_desc user_id bom_ver_id release_time Mandatory Y N N Y N N N Y Other Parameters Guide to Using ArchestrA Workflow with Wonderware MES .CreateWoFromProcess stateless API method to verify that the date fields entered on the client machine are correctly stored in the MES database on the host machine when they have different regional settings.JobExec.CWFP. • In the Generate Command window: • For the stateless API. use JobExec. use JobExec. use cwfp_input • For the Generate Output XML Variable. Creating the Workflow Perform the procedure in "Creating the Workflow" on page 14. The process for creating the Create a Work Order from a Process test procedure is the same as that described in "Adding a Job" on page 13. with exceptions as noted in the following topics. use cwfp_output Creating an ArchestrA Workflow Software Form Perform the procedure in "Creating an ArchestrA Workflow Software Form" on page 18.

ToLocalTime() Guide to Using ArchestrA Workflow with Wonderware MES . refer to "DateTime" on page 101.CWFP workflow.InvariantCulture) . click Next Tag Name Due Date/Time Required Quantity Start Quantity Priority OK Mapped XML Node req_finish_time req_qty start_qty priority ok Mandatory Y Y Y N Other Parameters Minimum Value: 0 Minimum Value: 0 Button Type: Submit Text: OK Is Form Level Button: Yes Button.SFFormData. System. To address the DateTime issue for these inputs. This test procedure includes Release Date/Time and Due Date/Time inputs in the workflow form. perform the procedure in "Adding a Variable for the DateTime Input" on page 23 to add the following variables: • The variable Release DateTime Local of type date and with the expression: Convert. Adding Variables for the DateTime Inputs Because of a difference in how ArchestrA Workflow Software and MES stateless API methods treat DateTime inputs.Creating a Work Order from a Process65 Control Type DateInput Number Number Number Button.CWFP form to the JobExec.SKRootDefinition.Globalization.release_time.CultureInfo. For additional information about this issue. you must create a DateTime variable to convert any DateTime input values from the workflow form from UTC time to local time. click Next Cancel cancel Button Type: Cancel Text: Cancel Is Form Level Button: Yes Binding the Form to the Workflow Perform the procedure in "Binding the Form to the Workflow" on page 21 to bind the JobExec.ToDateTime (XmlVariables.

SKRootDefinition. spec_ver_id XMLVariables. start_qty XMLVariables.ToDateTime (XmlVariables.cwfp_input.cwfp_input.request.request.SKRootDefinition.cwfp_input.Release DateTime Local* Variables. Variable Form Control Name XMLVariables.start_qty SKFormData.SFFormData.cwfp_input. wo_desc XMLVariables.request.66  Chapter 5 Verifying DateTimes with Different Regional Settings • The variable Due DateTime Local of type date and with the expression: Convert. wo_id XMLVariables.process_id SKFormData. bom_ver_id XMLVariables.request.request.SKRootDefinition.request.SKRootDefinition. process_id XMLVariables.cwfp_input.cwfp_input.request.cwfp_input.InvariantCulture) .cwfp_input.request.request.CWFP form controls.ToLocalTime() Linking the Workflow Variables to Form Controls Perform the procedure in "Linking the Workflow Variables to Form Controls" on page 26 to link the JobExec.request.CultureInfo.SKRootDefinition. wo_priority SKFormData.SKRootDefinition.request.SKRootDefinition.req_qty SKFormData.request.Globalization.bom_ver_id Variables.wo_desc SKFormData.SKRootDefinition.SKRootDefinition. System.Due DateTime Local* SKFormData.user_id SKFormData.cwfp_input.cwfp_input. req_finish_time_local XMLVariables.priority * DateTimes are set to workflow variables created to ensure that they are sent as localtime to the MES database. release_time_local XMLVariables.spec_ver_id SKFormData. Guide to Using ArchestrA Workflow with Wonderware MES .wo_id SKFormData. user_id XMLVariables.req_finish_time.item_id SKFormData.SKRootDefinition.CWFP workflow variables to the JobExec.cwfp_input.SKRootDefinition. req_qty XMLVariables. as listed in the following table. item_id XMLVariables.cwfp_input.

1 11/01/2012 04:00:00 11/16/2012 14:00:00 40 50 2 Guide to Using ArchestrA Workflow with Wonderware MES . Sample Test Data and Expected Results Sample test data that could be entered in the form. and the expected results in the MES database. Column Name Database Data Type Data Input Data Expected in MES Database Item Id Process Id Spec Version Id Work Order Id Work Order Description User Id BOM Version Id Release Time Local Required Finish Time Local Required Quantity Start Quantity Priority String80 String80 String 80 String 80 String80 String 80 String80 DateTime DateTIme Int32 Int32 Int32 Item-A Process_001 NULL TestWO Work_Order_TestWO Ww V.1 11/01/2012 04:00:00 11/16/2012 14:00:00 40 50 2 Item-A Process_001 NULL TestWO Work_Order_TestWO Ww V.CWFP form.CWFP workflow. Testing the Workflow Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.Creating a Work Order from a Process67 Publishing the Form Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec. are listed in the following table.A.A.

StartJob stateless API method to verify that a date entered on an ArchestrA form on a machine with one regional setting is correctly recorded in an MES database on a machine with a different regional setting for the *. use JobExec.StartJob.68  Chapter 5 Verifying DateTimes with Different Regional Settings Starting a Job This test procedure calls the Prod. with the following exceptions: • For the form title. • Specify the following controls for the form: Control Type Number or Lookup TextInput or Lookup TextInput TextInput Number Number TextInput Boolean Tag Name Entity ID User Name Work Order ID Operation ID Sequence Number Job Position Status Notes Check Privileges Mapped XML Node ent_id user_id wo_id op_id seq_no job_pos status_notes check_privs Mandatory Y Y Y Y Y N N Y Other Parameters Minimum: 0 Minimum: 0 Minimum: 0 Mode of Text: Multiple Guide to Using ArchestrA Workflow with Wonderware MES . use Prod. use startjob_output Creating an ArchestrA Workflow Software Form Perform the procedure in "Creating an ArchestrA Workflow Software Form" on page 18.StartJob • For the Generate Input XML Variable.JobExec. with exceptions as noted in the following topics.JobExec.StartJob. use startjob_input • For the Generate Output XML Variable. • In the Generate Command window: • For the stateless API. with the following exceptions: • For the workflow title. and *_utc fields. *_local. Creating the Workflow Perform the procedure in "Creating the Workflow" on page 14. use JobExec. The process for creating the Start a Job test procedure is the same as that described in "Adding a Job" on page 13.

request.StartJob form to the JobExec.request.StartJob workflow variables to the JobExec.user_id *DateTime is set to workflow variable created to ensure that it is sent as localtime to the MES database.InvariantCulture) .cwfp_input. This test procedure includes an Event Time input in the workflow form. perform the procedure in "Adding a Variable for the DateTime Input" on page 23 to add the following variable: • The variable Event DateTime Local of type date and with the expression: Convert.Starting a Job69 Control Type Boolean DateInput Tag Name Check Certifications Event Time Mapped XML Node check_certs event_time Mandatory Y N Other Parameters Binding the Form to the Workflow Perform the procedure in "Binding the Form to the Workflow" on page 21 to bind the JobExec. To address the DateTime issue for this input. ent_id XMLVariables. refer to "DateTime" on page 101.event_time. Guide to Using ArchestrA Workflow with Wonderware MES .ToDateTime (XmlVariables.SKRootDefinition.SKRootDefinition.StartJob form controls. System.Globalization.ToLocalTime() Linking the Workflow Variables to Form Controls Perform the procedure in "Linking the Workflow Variables to Form Controls" on page 26 to link the JobExec. Variable Form Control Name XMLVariables. as listed in the following table. you must create a DateTime variable to convert any DateTime input values from the workflow form from UTC time to local time. For additional information about this issue.cwfp_input.CultureInfo. Adding a Variable for the DateTime Input Because of a difference in how ArchestrA Workflow Software and MES stateless API methods treat DateTime inputs. user_id SKFormData.SFFormData.SKRootDefinition.StartJob workflow.ent_id SKFormData.

seq_no XMLVariables.seq_no SKFormData. check_certs XMLVariables. and the expected results in the MES database. check_privs XMLVariables.SKRootDefinition.oper_id SKFormData. Testing the Workflow Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.Event DateTime Local* *DateTime is set to workflow variable created to ensure that it is sent as localtime to the MES database. are listed in the following table.cwfp_input.SKRootDefinition.request. Column Name Database Data Type Data Input Data Expected in MES Database Ent Id User Id Work Order Id Int32 String 80 String 80 4 ww TestWO 4 ww TestWO Guide to Using ArchestrA Workflow with Wonderware MES .wo_id SKFormData. job_pos XMLVariables.StartJob workflow.SKRootDefinition. Sample Test Data and Expected Results Sample test data that could be entered in the form.request. status_notes XMLVariables.check_privs SKFormData.status_notes SKFormData. event_time_local SKFormData. wo_id XMLVariables.check_certs Variables.cwfp_input.cwfp_input.SKRootDefinition.cwfp_input.request.cwfp_input.request. Publishing the Form Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec.request.request.cwfp_input.cwfp_input.SKRootDefinition.cwfp_input.request.request.SKRootDefinition. oper_id XMLVariables.StartJob form.70  Chapter 5 Verifying DateTimes with Different Regional Settings Variable Form Control Name XMLVariables.job_pos SKFormData.SKRootDefinition.

Starting a Job71 Column Name Database Data Type Data Input Data Expected in MES Database Operation Id Sequence No Job Position Status Notes Check Privileges Check Certifications Event Time String80 Int32 Int32 String256 Logical Logical datetime OP-001 0 0 Testing start job Yes (True) No (False) 11/08/2012 5:00:00 OP-001 0 0 Testing start job True False Actual_start_time_local: 11/08/2012 5:00:00 Actual_start_time_utc: 11/08/2012 13:00:00 Actual_start_time: 11/08/2012 2:00:00 Guide to Using ArchestrA Workflow with Wonderware MES .

72  Chapter 5 Verifying DateTimes with Different Regional Settings Guide to Using ArchestrA Workflow with Wonderware MES .

ItemClass.AddProd.JobExec. The process for creating the Add an Item Class test procedure is the same as that described in "Adding a Job" on page 13. Adding an Item Class—MES SQL Database This test procedure calls the Prod. Guide to Using ArchestrA Workflow with Wonderware MES .Add.Add stateless API method to verify that strings of different languages can be passed correctly from the MES .Workflow Connector and be recorded in an MES SQL database. which adds an item class • Prod. with exceptions as noted in the following topics.73 Chapter 6 Verifying Localization of Datatypes The following stateless API methods can be used from the MES . which adds production to a job Note: Other stateless API methods can also be used to verify this functionality.Workflow Connector to verify that the localization of datatypes is being passed correctly from the Workflow to the MES database: • Prod.ItemClass.

with the following exceptions: • For the form title. • Specify the following controls for the form: Control Type TextInput TextInput Boolean Boolean Boolean Boolean Boolean Tag Name New Item Class Item Class Description Produced Consumed Obsolete Purchased Sold Mapped XML Node item_class_id item_class_desc produced consumed obsolete purchased sold Mandatory Y Y Other Parameters Label Position: Top Label Position: Top Label Position: Top Label Position: Top Label Position: Top Binding the Form to the Workflow Perform the procedure in "Binding the Form to the Workflow" on page 21 to bind the ItemClass. use Prod. use ItemClass.Add • For the Generate Input XML Variable.Add form to the ItemClass. use itemclass_output Creating an ArchestrA Workflow Software Form Perform the procedure in "Creating an ArchestrA Workflow Software Form" on page 18.Add. use ItemClass. use itemclass_input • For the Generate Output XML Variable.Add.74  Chapter 6 Verifying Localization of Datatypes Creating the Workflow Perform the procedure in "Creating the Workflow" on page 14.Add workflow.ItemClass. with the following exceptions: • For the workflow title. • In the Generate Command window: • For the stateless API. Guide to Using ArchestrA Workflow with Wonderware MES .

request.sold Publishing the Form Perform the procedure in "Publishing the Form" on page 31 to publish the ItemClass. purchased XMLVariables. sold SKFormData.Add workflow variables to the ItemClass. Sample Test Data and Expected Results Sample test data for several languages that could be entered in the form.request. Variable Form Control Name XMLVariables. consumed XMLVariables.Adding an Item Class—MES SQL Database75 Linking the Workflow Variables to Form Controls Perform the procedure in "Linking the Workflow Variables to Form Controls" on page 26 to link the ItemClass.item_class_input. Guide to Using ArchestrA Workflow with Wonderware MES . produced XMLVariables.Add form.SKRootDefinition.item_class_input.item_class_desc SKFormData. item_class_desc XMLVariables.item_class_input.purchased SKFormData.Add form controls.obsolete SKFormData.SKRootDefinition.item_class_input.Add workflow.consumed SKFormData.item_class_input. and the expected results in the MES database.item_class_input.SKRootDefinition.request.request. obsolete XMLVariables.request. Testing the Workflow Perform the procedure in "Testing the Workflow" on page 32 to test the ItemClass.item_class_id SKFormData.request.SKRootDefinition.request.item_class_input.produced SKFormData. item_class_id XMLVariables. as listed in the following table.SKRootDefinition.SKRootDefinition.SKRootDefinition. are listed in the following tables.

76  Chapter 6 Verifying Localization of Datatypes Chinese Column Name Database Data Type Data Input Data Expected in MES Database Item Class Id Item Class Desc Produced Consumed Obsolete Purchased Sold String80 String80 Logical Logical Logical Logical Logical 测试类 测试 Yes (True) Yes (True) No (False) No (False) No (False) 测试类 测试 True True False False False Spanish Column Name Database Data Type Data Input Data Expected in MES Database Item Class Id Item Class Desc Produced Consumed Obsolete Purchased Sold String80 String80 Logical Logical Logical Logical Logical Clase de prueba mañana mañana Yes (True) Yes (True) No (False) No (False) No False) Clase de prueba mañana mañana True True False False False French Column Name Database Data Type Data Input Data Expected in MES Database Item Class Id Item Class Desc Produced Consumed Obsolete Purchased Sold String80 String80 Logical Logical Logical Logical Logical Catégorie de l'élément Catégorie de l'élément Yes (True) Yes (True) No (False) No (False) No (False) Catégorie de l'élément Catégorie de l'élément True True False False False Guide to Using ArchestrA Workflow with Wonderware MES .

The process for creating the Add an Job test procedure is the same as that described in "Adding a Job" on page 13.Workflow Connector and be recorded in an MES Oracle database that accepts multi-byte characters.Adding a Job—Oracle Database77 Japanese Column Name Database Data Type Data Input Data Expected in MES Database Item Class Id Item Class Desc Produced Consumed Obsolete Purchased Sold String80 String80 Logical Logical Logical Logical Logical テスト項目クラス 日本でのテスト Yes (True) Yes (True) No (False) No (False) No (False) テスト項目クラス 日本でのテスト True True False False False Russian Column Name Database Data Type Data Input Data Expected in MES Database Item Class Id Item Class Desc Produced Consumed Obsolete Purchased Sold String80 String80 Logical Logical Logical Logical Logical Проверьте пункт класса Тест в Российской Yes (True) Yes (True) No (False) No (False) No (False) Проверьте пункт класса Тест в Российской True True False False False Adding a Job—Oracle Database This test procedure calls the Prod. Russian) can be passed correctly from the MES . with exceptions as noted in the following topics. Japanese.Job. Guide to Using ArchestrA Workflow with Wonderware MES .Add stateless API method to verify that strings that contain multi-byte characters (Chinese.

Add. • In the Generate Command window: • For the stateless API.Job. with the following exceptions: • For the workflow title. use Job.78  Chapter 6 Verifying Localization of Datatypes Prerequisites for Performing This Test For each language that uses multi-byte characters that you are testing. Note: This test will also work using an MES SQL database on an operating system in the multi-byte language being tested. use jobadd_output Creating an ArchestrA Workflow Software Form Perform the procedure in "Creating an ArchestrA Workflow Software Form" on page 18. with the following exceptions: • For the form title. Creating the Workflow Perform the procedure in "Creating the Workflow" on page 14.Add • For the Generate Input XML Variable. use Prod. • Specify the following controls for the form: Control Type TextInput or Lookup TextInput TextInput DateInput Number Tag Name Work Order ID Operation ID Sequence No Required Finish Date/Time Rework Mapped XML Node wo_id op_id seq_no req_finish_time rework Mandatory Y Y Y Y Y Other Parameters Minimum: 0 Maximum: 1 Number Number Initial Sched Entity ID Target Sched Entity ID int_sched_ent_id target_sched_ent Y Y Minimum: 0 Minimum: 0 Guide to Using ArchestrA Workflow with Wonderware MES . you must: • Create an MES Oracle database on the machine that is loaded with an operating system in the language you are testing. • Create a Workflow connection to this MES database. use jobadd_input • For the Generate Output XML Variable. use Job.Add.

ToLocalTime() Guide to Using ArchestrA Workflow with Wonderware MES . perform the procedure in "Adding a Variable for the DateTime Input" on page 23 to add the following variable: • The variable RequiredFinish DateTime Local of type date and with the expression: Convert.InvariantCulture) .ToDateTime (XmlVariables. Adding a Variable for the DateTime Input Because of a difference in how ArchestrA Workflow Software and MES stateless API methods treat DateTime inputs. you must create a DateTime variable to convert any DateTime input values from the workflow form from UTC time to local time.req_finish_time_ local.Add form to the Job.SKRootDefinition. This test procedure includes a Required Finish Date/Time input in the workflow form.Globalization.SFFormData.Adding a Job—Oracle Database79 Control Type Number Number TextInput TextInput TextInput Number Tag Name Quantity Required Quantity At Start Spare1 Last Edit Comment Item ID Estimated Production Rate Mapped XML Node req_qty start_qty spare1 last_edit_comment item_id est_prod_rate Mandatory Y Y Y Y Y Y Other Parameters Minimum: 0 Minimum: 0 Binding the Form to the Workflow Perform the procedure in "Binding the Form to the Workflow" on page 21 to bind the Job.CultureInfo. To address the DateTime issue for this input.System. refer to "DateTime" on page 101.Add workflow. For additional information about this issue.

Add form controls.jobadd_input.SKRootDefinition.SKRootDefinition.request. est_prod_rate SKFormData.last_edit_ comment SKFormData.jobadd_input. req_qty XMLVariables.SKRootDefinition.jobadd_input.SKRootDefinition.Add workflow variables to the Job. init_sched_ent_id XMLVariables.request.wo_id SKFormData.oper_id SKFormData.request. target_sched_ent_id XMLVariables. req_finish_time_local XMLVariables. Variables Form Control Name XMLVariables. Publishing the Form Perform the procedure in "Publishing the Form" on page 31 to publish the Job. rework XMLVariables.request.jobadd_input.est_prod_rate *DateTimes are set to workflow variables created to ensure that they are sent as localtime to the MES database.jobadd_input.RequiredFinish DateTime Local* SKFormData.request.SKRootDefinition.Add form. last_edit_comment XMLVariables. jobadd _input.rework SKFormData.jobadd_input.jobadd_input.SKRootDefinition.request.request.jobadd_input. as listed in the following table.req_qty SKFormData.start_qty SKFormData.target_sched_ ent_id SKFormData.request.SKRootDefinition.request.seq_no Variables.jobadd_input.SKRootDefinition.SKRootDefinition.SKRootDefinition. item_id XMLVariables. Guide to Using ArchestrA Workflow with Wonderware MES .item_id SKFormData. oper_id XMLVariables.request.request. spare1 XMLVariables. jobadd _input.init_sched_ent_ id SKFormData. wo_id XMLVariables. start_qty XMLVariables. seq_no XMLVariables.request.SKRootDefinition.spare1 SKFormData.80  Chapter 6 Verifying Localization of Datatypes Linking the Workflow Variables to Form Controls Perform the procedure in "Linking the Workflow Variables to Form Controls" on page 26 to link the Job.SKRootDefinition.jobadd_input.jobadd_input.request.

Russian.12345 No (False) 测试工作流程 测试工作流程 QA-Case24 1234567890123. and the expected results in the MES database.12345 Wo1 新的操作 12345 10/26/2012 15:16:17 15 15 1234567890123.Adding a Job—Oracle Database81 Testing the Workflow Perform the procedure in "Testing the Workflow" on page 32 to test the Job. Chinese Column Name Database Data Type Data Input Data Expected in MES Database Wo_ID Oper_Id Seq_No Req_Finish_Time_Local Init_Sched_Ent_Id Target_Sched_Ent_Id Qty_Reqd Qty_At_Start Rework Spare1 Last_Edit_Comment Item Est_Prod_Rate String80 String80 Int32 TDatetime Int32 Int32 TFloat TFloat Logical String80 String254 String80 TFloat Wo1 新的操作 12345 10/26/2012 15:16:17 15 15 1234567890123. are listed in the following tables.12 Russian Column Name Database Data Type Data Input Data Expected in MES Database Wo_ID Oper_Id Seq_No Req_Finish_Time_Local Init_Sched_Ent_Id String80 String80 Int32 TDatetime Int32 Wo1 Новой операции 12345 10/26/2012 15:16:17 15 Wo1 Новой операции 12345 10/26/2012 15:16:17 15 Guide to Using ArchestrA Workflow with Wonderware MES .12 1234567890123.12345 1234567890123. and Japanese that could be entered in the form.12 0 测试工作流程 测试工作流程 QA-Case24 1234567890123. Sample Test Data and Expected Results Sample test data for Chinese.Add workflow.

12345 1234567890123.82  Chapter 6 Verifying Localization of Datatypes Column Name Database Data Type Data Input Data Expected in MES Database Target_Sched_Ent_Id Qty_Reqd Qty_At_Start Rework Spare1 Last_Edit_Comment Item Est_Prod_Rate Int32 TFloat TFloat Logical String80 String254 String80 TFloat 15 1234567890123.12345 1234567890123.12 1234567890123.12345 15 1234567890123.12345 Wo1 新しい動作 12345 10/26/2012 15:16:17 15 15 1234567890123.12345 No (False) テストのワークフロー テストのワークフロー QA-Case24 1234567890123.12 1234567890123.12345 No (False) Проверка рабочего процесса Проверка рабочего процесса QA-Case24 1234567890123.12 Guide to Using ArchestrA Workflow with Wonderware MES .12 Japanese Column Name Database Data Type Data Input Data Expected in MES Database Wo_ID Oper_Id Seq_No Req_Finish_Time_Local Init_Sched_Ent_Id Target_Sched_Ent_Id Qty_Reqd Qty_At_Start Rework Spare1 Last_Edit_Comment Item Est_Prod_Rate String80 String80 Int32 TDatetime Int32 Int32 TFloat TFloat Logical String80 String254 String80 TFloat Wo1 新しい動作 12345 10/26/2012 15:16:17 15 15 1234567890123.12 0 テストのワークフロー テストのワークフロー QA-Case24 1234567890123.12 0 Проверка рабочего процесса Проверка рабочего процесса QA-Case24 1234567890123.

Adding Production to a Job83 Adding Production to a Job This test procedure calls the Prod. Creating the Workflow Perform the procedure in "Creating the Workflow" on page 14.JobExec.Workflow Connector and be recorded in the MES database. with exceptions as noted in the following topics. use JobExec.JobExec. use JobExec. • In the Generate Command window: • For the stateless API. use addprod_input • For the Generate Output XML Variable.AddProd • For the Generate Input XML Variable.AddProd stateless API method to verify that strings of different DateTime formats can be passed correctly from the MES . use addprod_output Creating an ArchestrA Workflow Software Form Perform the procedure in "Creating an ArchestrA Workflow Software Form" on page 18.AddProd. • Specify the following controls for the form: Control Type Number DateInput Tag Name Session ID Event Time Mapped XML Node session_id event_time Mandatory Y N Other Parameters Date Format: MM/dd/yyyy Time Format: HH:mm:ss TextInput or Lookup Number or Lookup Number Number TextInput User Name Entity ID Qty Produced Reason Code Lot No user_id ent_id qty_prod reas_cd lot_no Y Y Y N N Minimum: 0 Minimum: 0 Minimum: 0 Guide to Using ArchestrA Workflow with Wonderware MES .AddProd. with the following exceptions: • For the form title. use Prod. with the following exceptions: • For the workflow title. The process for creating the Add Production to a Job test procedure is the same as that described in "Adding a Job" on page 13.

as listed in the following table.SKRootDefinition.SFFormData.ToDateTime (XmlVariables. This test procedure includes an Event Time input in the workflow form.AddProd form to the JobExec.InvariantCulture) . perform the procedure in "Adding a Variable for the DateTime Input" on page 23 to add the following variable: • The variable Event DateTime Local of type date and with the expression: Convert. System. you must create a DateTime variable to convert any DateTime input values from the workflow form from UTC time to local time. refer to "DateTime" on page 101. To address the DateTime issue for this input.event_time.AddProd workflow variables to the JobExec.Globalization.CultureInfo.ToLocalTime() Linking the Workflow Variables to Form Controls Perform the procedure in "Linking the Workflow Variables to Form Controls" on page 26 to link the JobExec. Adding a Variable for the DateTime Input Because of a difference in how ArchestrA Workflow Software and MES stateless API methods treat DateTime inputs. Guide to Using ArchestrA Workflow with Wonderware MES .AddProd workflow. For additional information about this issue.AddProd form controls.84  Chapter 6 Verifying Localization of Datatypes Control Type TextInput Number or Lookup TextInput or Lookup Number TextInput TextInput Number Tag Name Sublot No Storage Entity ID Produced Item BOM Position Segment Requirement ID Seqment Response ID Job Position Mapped XML Node sublot_no to_ent_id item_id bom_pos seg_req_id seg_res_id job_pos Mandatory N N N N N N N Other Parameters Minimum: 0 Minimum: 0 Binding the Form to the Workflow Perform the procedure in "Binding the Form to the Workflow" on page 21 to bind the JobExec.

bom_pos XMLVariables.request.request. event_time_local XMLVariables.SKRootDefinition.SKRootDefinition.addprod_input.request.item_id SKFormData.SKRootDefinition. lot_no XMLVariables. storage_ent_id XMLVariables. seg_req_id XMLVariables.request.addprod_input.request.addprod_input.storage_ent_id SKFormData.SKRootDefinition.addprod_input. user_id XMLVariables.request.addprod_input.request.request.Adding Production to a Job85 Variables Form Control Name XMLVariables.Event DateTime Local* SKFormData.SKRootDefinition. seg_res_id XMLVariables.addprod_input.seg_res_id SKFormData.request.reas_cd SKFormData.bom_pos SKFormData.add_prod_input. sublot_no XMLVariables.addprod_input.SKRootDefinition.qty_prod SKFormData. ent_id XMLVariables.addprod_input. job_pos SKFormData.SKRootDefinition.addprod_input.request.ent_id SKFormData.addprod_input.request. item_id XMLVariables.request.seg_req_id SKFormData. Guide to Using ArchestrA Workflow with Wonderware MES .addprod_input.request.SKRootDefinition. reas_cd XMLVariables.sublot_no SKFormData.session_id Variables.SKRootDefinition.SKRootDefinition. session_id XMLVariables.user_id SKFormData.SKRootDefinition.addprod_input.request.lot_no SKFormData.job_pos *DateTime is set to a workflow variable created to ensure that it is sent as localtime to the MES database.addprod_input.SKRootDefinition. qty_prod XMLVariables.SKRootDefinition.

86  Chapter 6 Verifying Localization of Datatypes Publishing the Form Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec. DateTime Format 1 • Date Format: MM/dd/yyyy • Time Format HH:mm:ss Column Name Database Data Type Data Input Data Expected in MES Database Session Id Event Time User Id Ent Id Qty Prod Reason Code Lot No Sublot No Storage Ent Id Produced Item Bom Position Segment Requirement ID Segment Response ID Job Position Int32 datetime String 80 Int32 Double Int32 String80 String80 Int32 String80 Int32 Null Null Int32 114 11/08/2012 5:00:00 ww 4 4 1 1 Null 4 Item-A Null Null Null 0 114 11/08/2012 5:00:00 ww 4 4 1 1 Null 4 Item-A Null 0 Guide to Using ArchestrA Workflow with Wonderware MES . and the expected results in the MES database. are listed in the following tables.AddProd workflow. Testing the Workflow Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.AddProd form. Sample Test Data and Expected Results Sample test data that could be entered in the form for various DateTime formats.

Adding Production to a Job87 DateTime Format 2 • Date Format: yyyy-MM-dd • Time Format hh:mm:ss tt Column Name Database Data Type Data Input Data Expected in MES Database Session Id Event Time User Id Ent Id Qty Prod Reason Code Lot No Sublot No Storage Ent Id Produced Item Bom Position Segment Requirement ID Segment Response ID Job Position Int32 datetime String 80 Int32 Double Int32 String80 String80 Int32 String80 Int32 Null Null Int32 114 2012-11-08 5:00:00 AM ww 4 4 1 1 Null 4 Item-A Null Null Null 0 114 11/08/2012 5:00:00 ww 4 4 1 1 Null 4 Item-A Null 0 DateTime Format 3 • Date Format: dd-mm-yyyy • Time Format hh:mm:ss tt Column Name Database Data Type Data Input Data Expected in MES Database Session Id Event Time User Id Ent Id Qty Prod Reason Code Lot No Int32 datetime String 80 Int32 Double Int32 String80 114 08-11-2012 5:00:00 PM ww 4 4 1 1 114 11/08/2012 17:00:00 ww 4 4 1 1 Guide to Using ArchestrA Workflow with Wonderware MES .

Nov.2012 5:00:00 PM ww 4 4 1 1 Null 4 Item-A Null Null Null 0 114 11/08/2012 17:00:00 ww 4 4 1 1 Null 4 Item-A Null 0 Guide to Using ArchestrA Workflow with Wonderware MES .MMM.yyyy • Time Format hh:mm:ss tt Column Name Database Data Type Data Input Data Expected in MES Database Session Id Event Time User Id Ent Id Qty Prod Reason Code Lot No Sublot No Storage Ent Id Produced Item Bom Position Segment Requirement ID Segment Response ID Job Position Int32 datetime String 80 Int32 Double Int32 String80 String80 Int32 String80 Int32 Null Null Int32 114 08.88  Chapter 6 Verifying Localization of Datatypes Column Name Database Data Type Data Input Data Expected in MES Database Sublot No Storage Ent Id Produced Item Bom Position Segment Requirement ID Segment Response ID Job Position String80 Int32 String80 Int32 Null Null Int32 Null 4 Item-A Null Null Null 0 Null 4 Item-A Null 0 DateTime Format 4 • Date Format: dd.

CreateWoFromProcess.JobExec. Guide to Using ArchestrA Workflow with Wonderware MES .89 Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow The following stateless API methods can be used from the MES .Workflow Connector to verify that the data of an MES activity is being correctly passed to an ArchestrA Workflow Software workflow: • Prod. which adds an item class • Prod.Add. which creates a work order from a process Note: Other stateless API methods can also be used to verify this functionality.ItemClass.

Add. Guide to Using ArchestrA Workflow with Wonderware MES . A list of stateless APIs that match the entry appears. 3 4 In the list. Creating the MES Event You have to create a Prod. click Prod. The parameter grid appears. In the box at the upper left.ItemClass.90  Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow Adding an Item Class This test procedure calls the Prod.Add event for this test procedure.ItemClass.Add stateless API method to verify that the data of an MES activity is correctly passed to the MES Workflow.ItemClass.ItemClass. Click the Process button. enter Prod. To create the MES event 1 2 Open MES Workflow Event Creator.

select item_class_id.Adding an Item Class91 5 In the parameter grid lists. MES Middleware Host and MES Service. 6 Click the Provision events in all connected Workflow Repositories button. The Workflows window appears. 7 8 9 10 Close the MES Workflow Event Creator window and restart the Creating the Workflow To create a workflow for the Add an Item Class test procedure 1 2 From Internet Explorer. Guide to Using ArchestrA Workflow with Wonderware MES . then item_class_desc. Click the Provision Post Hook button. click Workflows. Click OK to close the message. A message appears that confirms the successful provisioning of the event. and then produced. A message appears that confirms the successful provisioning of the event. On the Enterprise Console menu. log in to the ArchestrA Workflow Software’s Enterprise Console as an MES user. Click OK to close the message. and indicating that the MES Middleware services need to be restarted.

4 Complete the fields and options in the window as follows: Description Field/Option Title Description Unique Environment Name MES Middleware Machine Name Event Name Pre/Post Hook Object Name 5 The workflow title (e. Select the event that was created. Prod..g.92  Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow 3 On the Ribbon. Type item_class.Add Select Post Hook. Guide to Using ArchestrA Workflow with Wonderware MES . Select the environment name (e. Select the MES Middleware connection (e. The Workflow Options window appears.. The option on the workflow tasks defaults to Design the workflow now. Click Next and then click Save & Continue. ItemClass. mes40).g. MESDB_MES).. click the MES workflow icon.ItemClass.g.Add). A New MES Workflow window appears. A description of the workflow.

A workflow window appears. Guide to Using ArchestrA Workflow with Wonderware MES . 10 Right-click the Information1 activity and click Activity Properties. 9 On the tool bar. click the Link icon and create a link from the Start activity to the Information1 activity.Adding an Item Class93 6 7 8 Click Finish. Click and drag the Information activity onto the window to the right of the Start activity. In the Activities list. It includes a Start activity by default. click Human Activities.

select MES Users. The User Lookup window appears. Guide to Using ArchestrA Workflow with Wonderware MES . 15 Click Search.94  Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow 11 In the Actors section of the Activity Properties pane. 12 Click the User option.user_id in the list. type an MES user and select user_name. 13 In the list at the upper right. The Assign Actor(s) window appears. 14 In the search box. The user appears in the Available Resources box. click the Assign Actor(s) box button.

The Subject window appears. 19 In the Notification Contents section of the Activity Properties pane. 18 Click Update to save the assigned actor and close the Assign Actor(s) window. 20 In the main box. click the Subject box button. type New Item Class Created and press ENTER. 17 Click Update. The user appears in the Assign Actor(s) window. select MESEventData. 21 In the first field list. 22 In the second field list. Guide to Using ArchestrA Workflow with Wonderware MES .Adding an Item Class95 16 Select the user and click the right arrow button to add the user to the Selected Resources box. select XML Variables.

The tree closes and the variable is entered in the third list. 24 Click the item_class_id variable. 26 Use the same procedure to add the following variables to the main box: • item_class_desc • produced 27 In the second field list. select MESSPHookXmlData. A tree of available XML variables appears. 25 Press ENTER to create a new line and then click the Append button.96  Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow 23 Click the third list’s button. The variable is added to the main box. Guide to Using ArchestrA Workflow with Wonderware MES .

Right-click the Item Class grid and click New. Save the new item class. 29 Click the Update button. Select the Produced check box. item_class_description.Add workflow and click Publish. A message appears indicating the status of the publish operation. On the Enterprise Console menu. log in to the ArchestrA Workflow Software’s Enterprise Console as an MES user. and produced variables from the MESSPHookXmlData tree. An new item class row appears in the grid. 30 At the bottom of the Activity Properties pane. Click Production Definition. Verifying the Data To verify the data 1 2 From Internet Explorer. Type the item class ID and description. just as you did for the three MESEventData variables. click Save and close the workflow window. 31 In the Workflows window. The Subject window closes. right-click the ItemClass.Adding an Item Class97 28 Select and append the item_class_id. Starting the Workflow To start the workflow 1 2 3 4 5 6 7 Log in to MES Client. Guide to Using ArchestrA Workflow with Wonderware MES . The Dashboard window appears. Click Item Classes. 32 Click Close to close the message. click Dashboard.

The data in the body of the email should show the item_class_id. then release_time. The process for creating the Create a Work Order from a Process test procedure is similar to that described in "Adding an Item Class" on page 90.CreateWoFromProcess as the stateless API for the event. Guide to Using ArchestrA Workflow with Wonderware MES . Database Data Type Data Expected in MESEventData and MESSPHookData Column Name Data Input ItemClass Id Item Class Desc Produced String80 String80 Logical TestItemClass Test Item Class True TestItemClass Test Item Class True Creating a Work Order from a Process This test procedure calls the Prod. • In the parameter grid lists.98  Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow 3 Open the inbox information for the MES workflow you created with a Subject of “New Item Class Created”. and the item_class_id.JobExec. select wo_id. with the following exceptions: • In MES Workflow Event Creator.CreateWoFromProcess stateless API method to verify that data with dates correctly passed from the MES Middleware to the MES . select Prod. item_class_desc. They should agree with the values entered in MES Client when creating the item class. and produced value for the values being sent into the Post Hook.Workflow Connector. with exceptions as noted in the following topics.JobExec. and produced value for the values coming into the event. Creating the MES Event Perform the procedure in "Creating the MES Event" on page 90. and then req_finish_time. item_class_desc. Sample Test Data and Expected Results Sample test data and the expected results in MESEventData and MESSPHookData are listed in the following table.

with the following exceptions: • Complete the fields and options in the New MES Workflow window as follows: Field/Option Description Title Description Unique Environment Name MES Middleware Machine Name Event Name Pre/Post Hook Object Name WO Created. Select Post Hook. mes40).g..g.wo_id • MESSPHookeData: request.Creating a Work Order from a Process99 Creating the Workflow Perform the procedure in "Creating the Workflow" on page 91.release_time • MESEventData: request. • In the Subject window. Select the event that was created.req_finish_time • MESSPHookData: request. JobExec. The workflow title (e. Type job_exec. Right-click one of the processes and click Create Work Order.g. Select the environment name (e.release_time • MESSHookData: request.CWFP). Prod.CreateWoFromProcess.. in the first line of the main box. Click Production Definition. Guide to Using ArchestrA Workflow with Wonderware MES .. JobExec. type New • In the Subject window main box. Select the MES Middleware connection (e. MESDB_MES). Click Process Extension.req_finish_time Starting the Workflow To start the workflow 1 2 3 4 5 Log in to MES Client. Click Apply Filters.wo_id • MESEventData: request. A description of the workflow. append the following XML variables: • MESEventData: request.

log in to the ArchestrA Workflow Software’s Enterprise Console as an MES user. Click OK. Database Data Type Data Expected in MESEventData and MESSPHookData Column Name Data Input Work Order Id Release Time Local Required Finish Time Local String 80 DateTime DateTIme TestWO 11/01/2012 04:00:00 11/16/2012 14:00:00 TestWO 11/01/2012 04:00:00 11/16/2012 14:00:00 Guide to Using ArchestrA Workflow with Wonderware MES . Sample Test Data and Expected Results Sample test data and the expected results in MESEventData and MESSPHookData are listed in the following table. release_time. On the Enterprise Console menu. and req_finish_time value for the values being sent into the Post Hook. the required quantity. release_time. Open the inbox information for the MES workflow you created with a Subject of “New WO Created”. and the due date/time. the start quantity. Verifying the Data To verify the data 1 2 3 From Internet Explorer. and wo_id. and req_finish_time value for the values coming into the event. The data in the body of the email should show the wo_id. click Dashboard. The Dashboard window appears. the release date/time.100  Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow 6 7 Enter the wo_id. They should agree with the values entered in MES Client when creating the work order from the process.

the MES stateless API methods assume that times are in local time. This situation can cause incorrect times to be stored in the MES database. Guide to Using ArchestrA Workflow with Wonderware MES . ArchestrA Workflow Software converts any time inputs in a workflow form to UTC time. The time is then incorrectly recorded in the MES database as 1p local time and 8p UTC time. you must: • Create a DateTime variable in the Start activity for each DateTime variable in the MES XML. For example. certain issues can occur. However. These issues and their resolutions are addressed here. DateTime By default.101 Appendix A Potential Issues and Resolutions When executing the test procedures. To avoid this issue. it is converted to UTC time and passed as 1p to the MES stateless API method. if 6a PDT is entered in the workflow form. • Have the DateTime variables in MES receive values from these internal variables. This resolution is demonstrated in the example procedures in this document. • Convert the input value from the workflow form for each time DateTime variable from UTC time to local time. Following is a general description of the resolution.

In the Workflow Variables box. create a DateTime variable for the Start activity. The Variables window appears. include form controls for the DateTime variables in the Workflow form. Guide to Using ArchestrA Workflow with Wonderware MES . as shown in the following example. On the Activity Properties pane. Next. right-click the Start activity and click Activity Properties.102  Appendix A Potential Issues and Resolutions First. enter a name for the DateTime variable. The Activity Properties pane appears. The entries for these fields will be sent as parameters to the MES stateless API. click the Variables box button. To create a DateTime variable for a Start activity 1 2 3 With the workflow opened.

DateTime103

4

In the Type list, click date.

5 6

Click Update to save the entries and close the window. In the Activity Properties pane, click the Initialize box button. The Update Variable window appears.

7 8

In the Condition column, hover the pointer over Select and click the list box that appears. A navigation tree appears. Expand the Variables branch.

9

Click the entry for the DateTime variable you just created. A row for the DateTime variable is added to the table in the Update Variable window.

Guide to Using ArchestrA Workflow with Wonderware MES

104  Appendix A Potential Issues and Resolutions

10 Click the Tree icon under the Actions column. A list box appears in

the Value column.
11 Click the list box button. A navigation tree appears. 12 Click the Build Expression link. The Variable Editor window

appears.
13 In the navigation tree, expand the Workflow Instance,

XmlVariables, SFFormData, and SKRootDefinition branches.
14 Click and drag the corresponding XML variable entry to the Editor

pane. The XML variables object is added to the Editor pane.
15 Complete the entry in the Editor pane so that the full entry is

similar to the following example:

16 Click OK and then click Close to close the Variable Editor window.

The completed DateTime variable definition appears in the Update Variable window.
17 Click the OK to close the Update Variable window. 18 Click the Save button at the bottom of the Activity Properties

pane to save the DateTime variable.

Guide to Using ArchestrA Workflow with Wonderware MES

Regional Settings105

Finally, make sure that you link the DateTime variables to their workflow form controls. The following sample Update Variable window shows two DateTime variables mapped to their workflow form controls.

Regional Settings
When the MES Client and Middleware are in different time zones, the DateTimes do not work correctly between the two zones unless the workaround described in "DateTime" on page 101 is implemented on all the DateTime variables in the workflow forms.

Asynchronous Methods in the MES Stateless API Libraries
The Async methods (e.g., AddProdAsync, StartJobAsync, etc.) exposed in the stateless API libraries are not listed in MES - Workflow Connector. Therefore, a workflow cannot use the Async methods to initiate MES transactions.

MES Quality Modules
MES - Workflow Connector does not list the MES quality modules. Therefore, workflows are not tested against the MES quality module.

Guide to Using ArchestrA Workflow with Wonderware MES

. these methods are not tested from MES . Therefore. ExtendedAttribute [ ] extendedAttrs in Prod.Workflow Connector.Workflow Connector ignores the methods that contain class arrays.Workflow Connector. MES . InvTransferSource[ ] sourceList in EnProd. There was no indication given in the executing or waiting events in Workflow.).StartJob. When the bandwidth for the VPN caused it to run slowly. Guide to Using ArchestrA Workflow with Wonderware MES . attempting to start a job took awhile. Intermittent Failures on Reporting Status When testing maximum amounts.StorageExec. etc.g. there is no indication given in Workflow after MESXMLCommand is finished. It was later found using MES Client that the job was started.106  Appendix A Potential Issues and Resolutions Class Arrays in the List of Parameters When the stateless API methods contain class arrays (e. such as with JobExec.JobExec.AddPEMData. but a Completed message was never received in workflow. on a slow system.MoveInventory method. those methods are not exposed/accessible in MES .

68 D datatypes. adding 35 DateTimes testing with different regional settings 63 UTC/local time issue 101 document conventions 10 E event types. 90 C class arrays 106 creating a work order 42. configuring 12 workflow. 83 setting lot information for 55 starting 46. configuring 12 asynchronous methods 105 attribute. binding to workflow 21 form. testing 55 F form controls.107 Index A adding a job 13. publishing 30 workflow. 90 adding production to a job 49. testing localization of 73 Guide to Using ArchestrA Workflow with Wonderware MES . 73. 77 adding production to 49. adding 40. 98 J job adding 13. 73. 64. 83 ArchestrA Workflow form. testing 32 ArchestrA Workflow Repository database. creating 18 form. linking to workflow variables 26 forms binding to workflow 21 creating 18 publishing 31 I item class. 58. publishing 31 linking variables to form controls 26 logging in 12 users. 77 adding an attribute 35 adding an item class 40.

testing 73 lot information. configuring 12 MES quality modules 105 MES users.Workflow Connector. 58.108Index L local time/UTC issue with DateTime inputs 101 localization of datatypes. initial 12 Start activity. 68 T technical support 10 Guide to Using ArchestrA Workflow with Wonderware MES . setting for a job 55 M MES . adding a variable to 23 starting a job 46. creating 42. configuring 12 testing complex event types 55 data from MES to Workflow 89 data of various types and amounts 39 datatype compatibility 13 DateTimes with different regional settings 63 localization of datatypes 73 U UTC/local time issue with DateTime inputs 101 P prerequisites for performing tests 11 V variables adding to Start activity 23 linking to form controls 26 R regional settings 105 testing 63 reporting status failures 106 W work order. 98 workarounds to test procedure issues 101 workflows creating 14 linking variables to form controls 26 publishing 30 testing 32 S setup. 64.

Sign up to vote on this title
UsefulNot useful