0% found this document useful (0 votes)
425 views

AAWorkflowWithMES Dec2012

No part of this documentation shall be reproduced 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. The information in this documentation is subject to change without notice.

Uploaded by

javiertdzo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
425 views

AAWorkflowWithMES Dec2012

No part of this documentation shall be reproduced 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. The information in this documentation is subject to change without notice.

Uploaded by

javiertdzo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 108

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 [email protected]. 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.

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 Softwares Enterprise Console .................................................................................... 11 12 12 12 12 12

Guide to Using ArchestrA Workflow with Wonderware MES

Contents

Chapter 2

Verifying Datatype Compatibility .................. 13


Adding a Job ................................................................................... Creating the Workflow ................................................................ Creating an ArchestrA Workflow Software Form ..................... Binding the Form to the Workflow ............................................ Adding a Variable for the DateTime Input ................................ Linking the Workflow Variables to Form Controls ................... Publishing the Form ................................................................... Testing the Workflow .................................................................. Sample Test Data and Expected Results ............................... Adding an Attribute ....................................................................... Creating the Workflow ................................................................ Creating an ArchestrA Workflow Software Form ..................... Binding the Form to the Workflow ............................................ Linking the Workflow Variables to Form Controls ................... Publishing the Form ................................................................... Testing the Workflow .................................................................. Sample Test Data and Expected Results ............................... 13 14 18 21 23 26 31 32 33 35 35 35 36 36 36 36 37

Chapter 3

Verifying Minimum and Maximum Data ......... 39


Adding an Item Class ..................................................................... Creating the Workflow ................................................................ Creating an ArchestrA Workflow Software Form ..................... Binding the Form to the Workflow ............................................ Linking the Workflow Variables to Form Controls ................... Publishing the Form ................................................................... Testing the Workflow .................................................................. Sample Test Data and Expected Results ............................... Creating a Work Order from a Process ......................................... Creating the Workflow ................................................................ Creating an ArchestrA Workflow Software Form ..................... Binding the Form to the Workflow ............................................ Adding Variables for the DateTime Inputs ............................... Linking the Workflow Variables to Form Controls ................... Publishing the Form ................................................................... Testing the Workflow .................................................................. Sample Test Data and Expected Results ............................... 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

Contents5

Starting a Job ................................................................................. Creating the Workflow ................................................................ Creating an ArchestrA Workflow Software Form ..................... Binding the Form to the Workflow ............................................ Adding a Variable for the DateTime Input ................................ Linking the Workflow Variables to Form Controls ................... Publishing the Form ................................................................... Testing the Workflow .................................................................. Sample Test Data and Expected Results ............................... Adding Production to a Job ............................................................ Creating the Workflow ................................................................ Creating an ArchestrA Workflow Software Form ..................... Binding the Form to the Workflow ............................................ Adding a Variable for the DateTime Input ................................ Linking the Workflow Variables to Form Controls ................... Publishing the Form ................................................................... Testing the Workflow .................................................................. Sample Test Data and Expected Results ...............................

46 46 46 47 47 48 48 48 49 49 49 50 50 50 51 52 52 52

Chapter 4

Verifying Complex Event Types .................... 55


Setting the Current Lot Information for a Job ............................. Creating the Workflow ................................................................ Creating an ArchestrA Workflow Software Form ..................... Binding the Form to the Workflow ............................................ Linking the Workflow Variables to Form Controls ................... Publishing the Form ................................................................... Testing the Workflow .................................................................. Sample Test Data and Expected Results ............................... Starting a Job ................................................................................. Creating the Workflow ................................................................ Creating an ArchestrA Workflow Software Form ..................... Binding the Form to the Workflow ............................................ Adding a Variable for the DateTime Input ................................ Linking the Workflow Variables to Form Controls ................... Publishing the Form ................................................................... Testing the Workflow .................................................................. Sample Test Data and Expected Results ............................... 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

Contents

Chapter 5

Verifying DateTimes with Different Regional Settings................................................... 63


Prerequisites for Performing the Tests ......................................... Creating a Work Order from a Process ......................................... Creating the Workflow ................................................................ Creating an ArchestrA Workflow Software Form ..................... Binding the Form to the Workflow ............................................ Adding Variables for the DateTime Inputs ............................... Linking the Workflow Variables to Form Controls ................... Publishing the Form ................................................................... Testing the Workflow .................................................................. Sample Test Data and Expected Results ............................... Starting a Job ................................................................................. Creating the Workflow ................................................................ Creating an ArchestrA Workflow Software Form ..................... Binding the Form to the Workflow ............................................ Adding a Variable for the DateTime Input ................................ Linking the Workflow Variables to Form Controls ................... Publishing the Form ................................................................... Testing the Workflow .................................................................. Sample Test Data and Expected Results ............................... 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 ............... 73


Adding an Item ClassMES SQL Database ................................ Creating the Workflow ................................................................ Creating an ArchestrA Workflow Software Form ..................... Binding the Form to the Workflow ............................................ Linking the Workflow Variables to Form Controls ................... Publishing the Form ................................................................... Testing the Workflow .................................................................. Sample Test Data and Expected Results ............................... Adding a JobOracle Database .................................................... Prerequisites for Performing This Test ..................................... Creating the Workflow ................................................................ Creating an ArchestrA Workflow Software Form ..................... Binding the Form to the Workflow ............................................ Adding a Variable for the DateTime Input ................................ Linking the Workflow Variables to Form Controls ................... Publishing the Form ................................................................... Testing the Workflow .................................................................. Sample Test Data and Expected Results ............................... 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

Contents7

Adding Production to a Job ............................................................ Creating the Workflow ................................................................ Creating an ArchestrA Workflow Software Form ..................... Binding the Form to the Workflow ............................................ Adding a Variable for the DateTime Input ................................ Linking the Workflow Variables to Form Controls ................... Publishing the Form ................................................................... Testing the Workflow .................................................................. Sample Test Data and Expected Results ...............................

83 83 83 84 84 84 86 86 86

Chapter 7

Verifying Data Passing from Wonderware MES to an ArchestrA Workflow ........................... 89


Adding an Item Class ..................................................................... 90 Creating the MES Event ............................................................ 90 Creating the Workflow ................................................................ 91 Starting the Workflow ................................................................ 97 Verifying the Data ....................................................................... 97 Sample Test Data and Expected Results ............................... 98 Creating a Work Order from a Process ......................................... 98 Creating the MES Event ............................................................ 98 Creating the Workflow ................................................................ 99 Starting the Workflow ................................................................ 99 Verifying the Data ..................................................................... 100 Sample Test Data and Expected Results ............................. 100

Appendix A

Potential Issues and Resolutions ................ 101


DateTime ...................................................................................... Regional Settings ......................................................................... Asynchronous Methods in the MES Stateless API Libraries .... MES Quality Modules .................................................................. Class Arrays in the List of Parameters ...................................... Intermittent Failures on Reporting Status ................................ 101 105 105 105 106 106

Index..................................................... 107

Guide to Using ArchestrA Workflow with Wonderware MES

Contents

Guide to Using ArchestrA Workflow with Wonderware MES

Welcome

This document describes generic ArchestrA Workflow Software workflows that use the ArchestrA Workflow Softwares MES - Workflow Connector to test the communication between the workflows and Wonderware MES Middleware. You can use these tests to gain an understanding of how to set up and use the MES - Workflow Connector to transfer data between an ArchestrA Workflow Software workflow and the Wonderware MES database and activities via the MES Middleware. The document also includes an appendix that describes how to resolve issues that could occur when running the test workflows. This document applies to the following software versions:

Wonderware MES 2012 ArchestrA Workflow Softwares MES - Workflow Connector v1.6
You can view this document online or you can print it, in part or whole, by using the print feature in Adobe Acrobat Reader. This guide assumes you know how to use Microsoft Windows, including navigating menus, moving from application to application, and moving objects on the screen. If you need help with these tasks, see the Microsoft Online Help. In some areas of the MES - Workflow Connector application, you can also right-click to open a menu. The items listed on this menu change, depending on where you are in the product. All items listed on this menu are available as items on the main menus.

Guide to Using ArchestrA Workflow with Wonderware MES

10

Documentation Conventions
This documentation uses the following conventions:
Convention Used for

Initial Capitals
Bold Monospace

Paths and file names. Menus, commands, dialog box names, and dialog box options. Code samples and display text.

Technical Support
Wonderware Technical Support offers a variety of support options to answer any questions on Wonderware products and their implementation. Before you contact Technical Support, refer to the relevant section(s) in this documentation for a possible solution to the problem. If you need to contact technical support for help, have the following information ready:

The type and version of the operating system you are using. Details of how to recreate the problem. The exact wording of the error messages you saw. Any relevant output listing from the Log Viewer or any other
diagnostic applications.

Details of what you did to try to solve the problem(s) and your
results.

If known, the Wonderware Technical Support case number


assigned to your problem, if this is an ongoing problem.

Wonderware MES Client Users Guide

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 - Workflow Connector, refer to the ArchestrA Workflow Software MES - Workflow Connector User Guide.

Prerequisites for Performing the Tests


The following prerequisites are required before the tests can be performed:

MES Client and the MES database are installed. ArchestrA Workflow Software and MES - Workflow Connector
package is installed.

You can start with a new MES database or with a pre-populated


database to test the workflowMES integration. For example, a reliable data script can be used to populate the MES database, or you can populate the database with data of your own choice.

The test procedures provided here assume that the user has some
knowledge about MES software and ArchestrA Workflow Software.

Guide to Using ArchestrA Workflow with Wonderware MES

12 Chapter 1 Getting Started

Initial Setup
Configuring MES and ArchestrA Workflow Software Users
Users must be configured in MES and ArchestrA Workflow Software. Refer to the MES Client Users Guide and the ArchestrA Workflow Software Administrator Guide for details.

Configuring MES - Workflow Connector


Refer to the web site below to configure the MES - Workflow Connector: http://sun.skelta.com/System Platform User Guide/ index.html?ConfiguringTheMiddleware

Configuring the ArchestrA Workflow Software Repository Database


Create an ArchestrA Workflow Software Repository database, and configure the repository in ArchestrA Workflow Software.

Logging in to ArchestrA Workflow Softwares Enterprise Console


To log in to ArchestrA Workflow Softwares Enterprise Console 1 2 3 4

Launch Internet Explorer. Click Enterprise Console on the Favorites tab. Click MES Users. Login using the user name and password configured in the MES database.

Guide to Using ArchestrA Workflow with Wonderware MES

13

Chapter 2 Verifying Datatype Compatibility

The following stateless MES API methods can be used from the MES - Workflow Connector to verify that the datatypes used in MES are compatible with the datatypes used in the MES - Workflow Connector:

Prod.Job.Add, which adds a job Core.Attr.Add, which adds an attribute


Note: Other stateless API methods can also be used to verify this functionality.

Adding a Job
This test procedure calls the Prod.Job.Add stateless API method. 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

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, log in to the Enterprise Console as an MES user. On the Enterprise Console menu, click Workflows. The Workflows window appears. On the Ribbon, click the Workflow icon. A New Workflow window appears.

Type the title (e.g., Job.Add), and then click Save and Continue. The Workflow Options window appears. The option on the workflow tasks defaults to Design the workflow now.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding a Job15

5 6 7

Click Finish. A workflow window appears. It includes a Start activity by default. In the Activities list, click Engine Activities. Click and drag the Update Variable activity onto the window to the right of the Start activity.

8 9

On the Activities menu, click MES. Click and drag the MESXMLCommand activity onto the window to the right of the UpdateVariable activity.

Guide to Using ArchestrA Workflow with Wonderware MES

16 Chapter 2 Verifying Datatype Compatibility

10 On the tool bar, click the Link icon and create a link from the Start

activity to the UpdateVariable1 activity.


11 Create another link from the UpdateVariable1 activity to the

MESXMLCommand1 activity.

12 Right-click the link between the UpdateVariable1 and

MESXMLCommand1 activities and click Updated.


13 Right-click the MESXMLCommand1 activity and click Activity
Properties.

14 In the Configuration section of the Activity Properties pane, click

the Generate Command box button.

The Generate Command window appears.


15 In the Unique Environment Name list, select the environment (for

example, MESDB_MES).
16 In the Middleware Connection list, select the Middleware

connection (for example, mes40).


17 In the Stateless API/SP Reference box, begin typing Prod.Job.Add until that entry appears in the list, select it, and

then press the ENTER key.

18 Select the Generate Input XML Variable check box and type job_input in the box.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding a Job17

19 Select the Generate Output XML Variable check box and type job_output in the box.

20 Click the Generate Input/Output XML Variable(s) button. 21 At the bottom of the Activity Properties pane, click Save and close

the workflow window.

Guide to Using ArchestrA Workflow with Wonderware MES

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, point to Tools, and then click Manage Forms. The Manage Forms window appears.

On the Ribbon, click Form. A New Form window appears.

In the Title box, type a title for the form (for example, Job.Add), and click Save & Continue. You are prompted to select a forms task.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding a Job19

Select the Design this form option and click Finish. The Forms Designer window appears with the Job.Add form listed.

Perform the following steps to add each of the controls and set their properties. For a list of the controls and their properties, see the table that follows these steps.
a

On the tool bar, click Add New. A prompt to select the control type appears.

b c

In the radio button list, select the control type and then click Next. The controls properties window appears. On the Basic tab, enter the controls properties as specified in the table.

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.

When you have finished entering the controls properties, click Save. The control is added to the form.

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

Adding a Job21

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

When you have finished adding all of the controls, click the Finish button at the bottom right of the Forms Designer window.

Binding the Form to the Workflow


To bind the form to the workflow 1 2 3

On the Enterprise Console menu, point to Tools, and then click Manage Forms. Select the Job.Add form. On the Ribbon, click Associate.

The Bind window appears.


4

For the Select Task option, select Bind to an existing workflow. Two list boxes appear to the right of the option.

Guide to Using ArchestrA Workflow with Wonderware MES

22 Chapter 2 Verifying Datatype Compatibility

In the first list, click the workflow name (that is, for the Add a Job procedure, Job.Add). In the second list, click Latest.

6 7 8 9

Click Save and then click Close to close the window. On the Enterprise Console menu, click Workflows. Select the appropriate workflow (that is, Job.Add). On the Ribbon, click Edit. The Edit Form window appears.

10 Click Save & Continue. The Workflow Options window appears. 11 Select the Design the Workflow now check box and then click
Finish to close the window. The Job.Add workflow window appears.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding a Job23

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. For additional information about this issue, refer to "DateTime" on page 101. This test procedure includes a required finish time input in the workflow form. To address the DateTime issue for this input, the DateTime variable called reqfinishtimevar will be added to the Start activity.
To add the reqfinishtimevar variable to the Start activity 1

With the Job.Add workflow opened, right-click the Start activity and click Activity Properties. The Activity Properties pane appears. On the Activity Properties pane, click the Variables box button. The Variables window appears. In the Workflow Variables box, enter reqfinishtimevar. In the Type list, click date.

2 3 4

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.

Guide to Using ArchestrA Workflow with Wonderware MES

24 Chapter 2 Verifying Datatype Compatibility

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 and click the Variable.reqfinishtimevar entry.

A row for the reqfinishtimevar variable is added to the table in the


Update Variable window.

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

10 Click the list box button. A navigation tree appears.

11 Click the Build Expression link. The Variable Editor window

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

XmlVariables, SFFormData, and SKRootDefinition branches.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding a Job25

13 Click and drag the entry req_finish_time_local to the Editor pane.

The XML variables object is added to the Editor pane.

14 Complete the entry in the Editor pane so that the full entry is as

follows: Convert.ToDateTime(XmlVariables.SFFormData. SKRootDefinition.req_finish_time_local, System.Globalization.CultureInfo.InvariantCulture). ToLocalTime()

Guide to Using ArchestrA Workflow with Wonderware MES

26 Chapter 2 Verifying Datatype Compatibility

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

The completed reqfinishtimevar variable definition appears in the Update Variable 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.

Linking the Workflow Variables to Form Controls


To link the workflow variables to their corresponding form controls 1

In the workflow window, right-click the UpdateVariable1 activity and click Activity Properties. The Activity Properties pane appears. In the Activity Properties pane, click the Set Variable box button. The Update Variable window appears.

Perform the following steps to link each variable to its corresponding form control. For a list of the workflow variable-to-form control link mapping, see the table that follows these steps.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding a Job27

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

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

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

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
XmlVariablesrequest.job.wo_id XmlVariablesrequest.job.oper_id XmlVariablesrequest.job.seq_no XmlVariablesrequest.job.req_finish_time_local XmlVariablesrequest.job.init_sched_ent_id XmlVariablesrequest.job.target_sched_ent_id XmlVariablesrequest.job.qty_reqd XmlVariablesrequest.job.qty_at_start XmlVariablesrequest.job.rework XmlVariablesrequest.job.spare1 XmlVariablesrequest.job.last_edit_comment XmlVariablesrequest.job.item_id XmlVariablesrequest.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 Job29

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

30 Chapter 2 Verifying Datatype Compatibility

In the Workflows window, right-click the Job.Add workflow and click Publish.

A message appears indicating the status of the publish operation.


7

Click Close to close the message.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding a Job31

Publishing the Form


To publish the form 1 2

On the Enterprise Console menu, point to Tools, and then click Manage Forms. The Manage Forms window appears. Right-click the Job.Add form and click Publish.

A message appears indicating the status of the publish operation.


3

Click Close to close the message.

Guide to Using ArchestrA Workflow with Wonderware MES

32 Chapter 2 Verifying Datatype Compatibility

Testing the Workflow


Now that the form has been created, you can test the procedure by completing the form and then checking to see if the data was entered correctly in the MES database.
To test the workflow 1

On the Enterprise Console menu, click Fill Form. A list of available forms appears.

Click the Job.Add form entry. The Job.Add form appears.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding a Job33

Complete the form with test data.

4 5 6

When the form is completed, click Finish. A message appears indicating the status of the form submission. Click OK to close the message. Verify that the test data was correctly entered in the MES database.

Sample Test Data and Expected Results


Two sets of sample test data that could be entered in the form, and the expected results in the MES database, are listed in the following tables.
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

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 1234567890123.12345 No (False) Test Spare1 Test Last Edit Comment QA-Case24 1234567890123.12345

1234567890123.12 1234567890123.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.987654 987654321.987654 Yes (True) Test Spare1 Test Last Edit Comment QA-Case24 987654321.987654

Wo1 Oper2 12345 10/29/2012 18:19:20 15 15 987654321.987654 987654321.987654 True Test Spare1 Test Last Edit Comment QA-Case24 987654321.987654

Guide to Using ArchestrA Workflow with Wonderware MES

Adding an Attribute35

Adding an Attribute
This test procedure calls the Core.Attr.Add stateless API method. 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, with exceptions as noted in the following topics.

Creating the Workflow


Perform the procedure in "Creating the Workflow" on page 14, with the following exceptions:

For the workflow title, use Attr.Add. In the Generate Command window: For the stateless API, use Core.Attr.Add For the Generate Input XML Variable, use attr_input For the Generate Output XML Variable, use attr_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, use Attr.Add. 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

Decimal Places: 0 Min Value: 0 Max Value: 12

TextInput

Attribute Description

attr_desc

Guide to Using ArchestrA Workflow with Wonderware MES

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.

Linking the Workflow Variables to Form Controls


Perform the procedure in "Linking the Workflow Variables to Form Controls" on page 26, with the following exceptions:

Link the following workflow variables to their corresponding form


controls:
Variable Form Control Name

XmlVariablesrequest.attr.predefined XmlVariablesrequest. attr.data_type XmlVariablesrequest. attr.attr_desc XmlVariablesrequest. attr.attr_grp XmlVariablesrequest. attr.filtr XmlVariablesresponse.attr_id XmlVariablesresponse.last_edit_at

SKFormData.SKRootDefinition.predefined SKFormData.SKRootDefinition.datatype SKFormData.SKRootDefinition.attr_desc SKFormData.SKRootDefinition.attr_grp SKFormData.SKRootDefinition.filtr SKFormData.SKRootDefinition.attr_id SKFormData.SKRootDefinition.last_edit_at

Publishing the Form


Perform the procedure in "Publishing the Form" on page 31.

Testing the Workflow


Perform the procedure in "Testing the Workflow" on page 32.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding an Attribute37

Sample Test Data and Expected Results


Sample test data that could be entered in the form, and the expected results in the MES database, are listed in the following table.
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

38 Chapter 2 Verifying Datatype Compatibility

Guide to Using ArchestrA Workflow with Wonderware MES

39

Chapter 3 Verifying Minimum and Maximum Data

The following stateless API methods can be used from the MES - 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, and when calling API methods with a larger number of parameters of different datatypes that affect multiple tables in the database:

Prod.ItemClass.Add, which adds an item class Prod.JobExec.CreateWoFromProcess, which creates a work order
from a process

Prod.JobExec.StartJob, which starts a job Prod.JobExec.AddProd, which adds production to a job


Note: Other stateless API methods can also be used to verify this functionality.

Guide to Using ArchestrA Workflow with Wonderware MES

40 Chapter 3 Verifying Minimum and Maximum Data

Adding an Item Class


This test procedure calls the Prod.ItemClass.Add stateless API method to verify that a few parameters that affect only one database table can be passed correctly from the MES - Workflow Connector and be recorded in the MES database. The process for creating the Add an Item Class test procedure is the same as that described in "Adding a Job" on page 13, with exceptions as noted in the following topics.

Creating the Workflow


Perform the procedure in "Creating the Workflow" on page 14, with the following exceptions:

For the workflow title, use ItemClass.Add. In the Generate Command window: For the stateless API, use Prod.ItemClass.Add For the Generate Input XML Variable, use itemclass_input For the Generate Output XML Variable, use itemclass_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, use ItemClass.Add. 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

Adding an Item Class41

Binding the Form to the Workflow


Perform the procedure in "Binding the Form to the Workflow" on page 21 to bind the ItemClass.Add form to the ItemClass.Add workflow.

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.Add workflow variables to the ItemClass.Add form controls, as listed in the following table.
Variable Form Control Name

XMLVariables.item_class_input.request. item_class_id XMLVariables.item_class_input.request. item_class_desc XMLVariables.item_class_input.request. produced XMLVariables.item_class_input.request. consumed XMLVariables.item_class_input.request. obsolete XMLVariables.item_class_input.request. purchased XMLVariables.item_class_input.request. sold

SKFormData.SKRootDefinition.item_class_id SKFormData.SKRootDefinition.item_class_desc SKFormData.SKRootDefinition.produced SKFormData.SKRootDefinition.consumed SKFormData.SKRootDefinition.obsolete SKFormData.SKRootDefinition.purchased SKFormData.SKRootDefinition.sold

Publishing the Form


Perform the procedure in "Publishing the Form" on page 31 to publish the ItemClass.Add form.

Testing the Workflow


Perform the procedure in "Testing the Workflow" on page 32 to test the ItemClass.Add workflow.

Guide to Using ArchestrA Workflow with Wonderware MES

42 Chapter 3 Verifying Minimum and Maximum Data

Sample Test Data and Expected Results


Sample test data that could be entered in the form, and the expected results in the MES database, are listed in the following table.
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.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 - Workflow Connector and be recorded in the MES database. 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.

Creating the Workflow


Perform the procedure in "Creating the Workflow" on page 14, with the following exceptions:

For the workflow title, use JobExec.CWFP. In the Generate Command window: For the stateless API, use JobExec.CreateWoFromProcess For the Generate Input XML Variable, use cwfp_input For the Generate Output XML Variable, use cwfp_output

Guide to Using ArchestrA Workflow with Wonderware MES

Creating a Work Order from a Process43

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, use JobExec.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 DateInput Number Number Number Button, 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, 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.CWFP workflow.

Guide to Using ArchestrA Workflow with Wonderware MES

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, 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, refer to "DateTime" on page 101. This test procedure includes Release Date/Time and Due Date/Time inputs in the workflow form. To address the DateTime issue for these inputs, 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.ToDateTime (XmlVariables.SFFormData.SKRootDefinition.release_time, System.Globalization.CultureInfo.InvariantCulture) .ToLocalTime()

The variable Due DateTime Local of type date and with the
expression: Convert.ToDateTime (XmlVariables.SFFormData.SKRootDefinition.req_finish_time, System.Globalization.CultureInfo.InvariantCulture) .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.CWFP workflow variables to the JobExec.CWFP form controls, as listed in the following table.
Variable Form Control Name

XMLVariables.cwfp_input.request. item_id XMLVariables.cwfp_input.request. process_id XMLVariables.cwfp_input.request. spec_ver_id XMLVariables.cwfp_input.request. wo_id XMLVariables.cwfp_input.request. wo_desc

SKFormData.SKRootDefinition.item_id SKFormData.SKRootDefinition.process_id SKFormData.SKRootDefinition.spec_ver_id SKFormData.SKRootDefinition.wo_id SKFormData.SKRootDefinition.wo_desc

* 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

Creating a Work Order from a Process45

Variable

Form Control Name

XMLVariables.cwfp_input.request. user_id XMLVariables.cwfp_input.request. bom_ver_id XMLVariables.cwfp_input.request. release_time_local XMLVariables.cwfp_input.request. req_finish_time_local XMLVariables.cwfp_input.request. req_qty XMLVariables.cwfp_input.request. start_qty XMLVariables.cwfp_input.request. wo_priority

SKFormData.SKRootDefinition.user_id SKFormData.SKRootDefinition.bom_ver_id Variables.Release DateTime Local* Variables.Due DateTime Local* SKFormData.SKRootDefinition.req_qty SKFormData.SKRootDefinition.start_qty SKFormData.SKRootDefinition.priority

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

Publishing the Form


Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec.CWFP form.

Testing the Workflow


Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.CWFP workflow.

Sample Test Data and Expected Results


Sample test data that could be entered in the form, and the expected results in the MES database, are listed in the following table.
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

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.1 11/01/2012 04:00:00 11/16/2012 14:00:00 40 50 2

Ww V.A.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.JobExec.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 - Workflow Connector and be recorded in the MES database. The process for creating the Start 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.

Creating the Workflow


Perform the procedure in "Creating the Workflow" on page 14, with the following exceptions:

For the workflow title, use JobExec.StartJob. In the Generate Command window: For the stateless API, use Prod.JobExec.StartJob For the Generate Input XML Variable, use startjob_input For the Generate Output XML Variable, 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, use JobExec.StartJob.

Guide to Using ArchestrA Workflow with Wonderware MES

Starting a Job47

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.StartJob form to the JobExec.StartJob workflow.

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. For additional information about this issue, refer to "DateTime" on page 101. This test procedure includes an Event Time input in the workflow form. To address the DateTime issue for this input, 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.ToDateTime (XmlVariables.SFFormData.SKRootDefinition.event_time, System.Globalization.CultureInfo.InvariantCulture) .ToLocalTime()

Guide to Using ArchestrA Workflow with Wonderware MES

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.StartJob workflow variables to the JobExec.StartJob form controls, as listed in the following table.
Variable Form Control Name

XMLVariables.cwfp_input.request. ent_id XMLVariables.cwfp_input.request. user_id XMLVariables.cwfp_input.request. wo_id XMLVariables.cwfp_input.request. oper_id XMLVariables.cwfp_input.request. seq_no XMLVariables.cwfp_input.request. job_pos XMLVariables.cwfp_input.request. status_notes XMLVariables.cwfp_input.request. check_privs XMLVariables.cwfp_input.request. check_certs XMLVariables.cwfp_input.request. event_time_local

SKFormData.SKRootDefinition.ent_id SKFormData.SKRootDefinition.user_id SKFormData.SKRootDefinition.wo_id SKFormData.SKRootDefinition.oper_id SKFormData.SKRootDefinition.seq_no SKFormData.SKRootDefinition.job_pos SKFormData.SKRootDefinition.status_notes SKFormData.SKRootDefinition.check_privs SKFormData.SKRootDefinition.check_certs Variables.Event DateTIme Local*

*DateTime is set to workflow variable created to ensure that it is sent as localtime to the MES database.

Publishing the Form


Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec.StartJob form.

Testing the Workflow


Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.StartJob workflow.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding Production to a Job49

Sample Test Data and Expected Results


Sample test data that could be entered in the form, and the expected results in the MES database, are listed in the following table.
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.JobExec.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 - Workflow Connector and be recorded in the MES database. 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, with exceptions as noted in the following topics.

Creating the Workflow


Perform the procedure in "Creating the Workflow" on page 14, with the following exceptions:

For the workflow title, use JobExec.AddProd. In the Generate Command window: For the stateless API, use Prod.JobExec.AddProd For the Generate Input XML Variable, use addprod_input For the Generate Output XML Variable, use addprod_output

Guide to Using ArchestrA Workflow with Wonderware MES

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, with the following exceptions:

For the form title, use JobExec.AddProd. 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 form to the JobExec.AddProd workflow.

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. For additional information about this issue, refer to "DateTime" on page 101.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding Production to a Job51

This test procedure includes an Event Time input in the workflow form. To address the DateTime issue for this input, 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.ToDateTime (XmlVariables.SFFormData.SKRootDefinition.event_time, System.Globalization.CultureInfo.InvariantCulture) .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.AddProd workflow variables to the JobExec.AddProd form controls, as listed in the following table.
Variable Form Control Name

XMLVariables.addprod_input.request. session_id XMLVariables.add_prod_input.request. event_time_local XMLVariables.addprod_input.request. user_id XMLVariables.addprod_input.request. ent_id XMLVariables.addprod_input.request. qty_prod XMLVariables.addprod_input.request. reas_cd XMLVariables.addprod_input.request. lot_no XMLVariables.addprod_input.request. sublot_no XMLVariables.addprod_input.request. storage_ent_id XMLVariables.addprod_input.request. item_id

SKFormData.SKRootDefinition.session_id Variables.Event DateTime Local* SKFormData.SKRootDefinition.user_id SKFormData.SKRootDefinition.ent_id SKFormData.SKRootDefinition.qty_prod SKFormData.SKRootDefinition.reas_cd SKFormData.SKRootDefinition.lot_no SKFormData.SKRootDefinition.sublot_no SKFormData.SKRootDefinition.storage_ent_id SKFormData.SKRootDefinition.item_id

*DateTime is set to workflow variable created to insure that it is sent as localtime to the MES database.

Guide to Using ArchestrA Workflow with Wonderware MES

52 Chapter 3 Verifying Minimum and Maximum Data

Variable

Form Control Name

XMLVariables.addprod_input.request. bom_pos XMLVariables.addprod_input.request. seg_req_id XMLVariables.addprod_input.request. seq_res_id XMLVariables.addprod_input.request. job_pos

SKFormData.SKRootDefinition.bom_pos SKFormData.SKRootDefinition.seg_req_id SKFormData.SKRootDefinition.seg_res_id SKFormData.SKRootDefinition.job_pos

*DateTime is set to workflow variable created to insure that it is sent as localtime to the MES database.

Publishing the Form


Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec.AddProd form.

Testing the Workflow


Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.AddProd workflow.

Sample Test Data and Expected Results


Sample test data that could be entered in the form, and the expected results in the MES database, are listed in the following table.
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

Adding Production to a Job53

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

55

Chapter 4 Verifying Complex Event Types

The following stateless API methods can be used from the MES - Workflow Connector to verify that complex event types used in MES are compatible with the event types used in the MES - Workflow Connector

JobExec.SetCurLotData, which adds current lot information to a


job

Prod.JobExec.StartJob, which starts a job


Note: Other stateless API methods can also be used to verify this functionality.

Setting the Current Lot Information for a Job


This test procedure calls the overloaded method for the JobExec.SetCurLotData in the stateless API to verify that the workflow connector calls the correct overload method to record data in the MES database. 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.

Guide to Using ArchestrA Workflow with Wonderware MES

56 Chapter 4 Verifying Complex Event Types

Creating the Workflow


Perform the procedure in "Creating the Workflow" on page 14, with the following exceptions:

For the workflow title, use JobExec.SetCurLotData. In the Generate Command window: For the stateless API, use JobExec.SetCurLotData For the Generate Input XML Variable, use setcurlotdata_input For the Generate Output XML Variable, use
setcurlotdata_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, use JobExec.SetCurLotData. 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 form to the JobExec.SetCurLotData workflow.

Guide to Using ArchestrA Workflow with Wonderware MES

Setting the Current Lot Information for a Job57

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.SetCurLotData workflow variables to the JobExec.SetCurLotData form controls, as listed in the following table.
Variable XmlVariablesrequest.ent_id XmlVariablesrequest. job_pos XmlVariablesrequest. bom_pos XmlVariablesrequest. cur_item_id XmlVariablesrequest.cur_lot_no XmlVariablesrequest.cur_sublot_no XmlVariablesrequest.cur_reas_cd XmlVariablesrequest.cur_storage_ent_id XmlVariablesrequest.cur_backflush XmlVariablesrequest.cur_update_inv Form Control Name SKFormData.SKRootDefinition.ent_id SKFormData.SKRootDefinition.job_pos SKFormData.SKRootDefinition.bom_pos SKFormData.SKRootDefinition.cur_item_id SKFormData.SKRootDefinition.cur_lot_no SKFormData.SKRootDefinition.cur_sublot_no SKFormData.SKRootDefinition.cur_reas_cd SKFormData.SKRootDefinition.cur_storage_ent_id SKFormData.SKRootDefinition.cur_backflush SKFormData.SKRootDefinition.cur_update_inv

Publishing the Form


Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec.SetCurLotData form.

Testing the Workflow


Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.SetCurLotData workflow.

Sample Test Data and Expected Results


Sample test data that could be entered in the form, and the expected results in the MES database, are listed in the following table.
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

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.12 4 False False

Starting a Job
This test procedure calls the Prod.JobExec.StartJob stateless API method to verify that the MES - Workflow Connector calls the correct overload method to send data to the MES database. The process for creating the Start 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.

Creating the Workflow


Perform the procedure in "Creating the Workflow" on page 14, with the following exceptions:

For the workflow title, use JobExec.StartJob. In the Generate Command window: For the stateless API, use Prod.JobExec.StartJob For the Generate Input XML Variable, use startjob_input For the Generate Output XML Variable, 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, use JobExec.StartJob.

Guide to Using ArchestrA Workflow with Wonderware MES

Starting a Job59

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.StartJob form to the JobExec.StartJob workflow.

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. For additional information about this issue, refer to "DateTime" on page 101. This test procedure includes an Event Time input in the workflow form. To address the DateTime issue for this input, 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.ToDateTime (XmlVariables.SFFormData.SKRootDefinition.event_time, System.Globalization.CultureInfo.InvariantCulture) .ToLocalTime()

Guide to Using ArchestrA Workflow with Wonderware MES

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.StartJob form controls, as listed in the following table.
Variable Form Control Name

XMLVariables.cwfp_input.requrest. ent_id XMLVariables.cwfp_input.request. user_id XMLVariables.cwfp_input.request. wo_id XMLVariables.cwfp_input.request. oper_id XMLVariables.cwfp_input.request. seq_no XMLVariables.cwfp_input.request. job_pos XMLVariables.cwfp_input.request. status_notes XMLVariables.cwfp_input.request. check_privs XMLVariables.cwfp_input.request. check_certs XMLVariables.cwfp_input.request. event_time_local

SKFormData.SKRootDefinition.ent_id SKFormData.SKRootDefinition.user_id SKFormData.SKRootDefinition.wo_id SKFormData.SKRootDefinition.oper_id SKFormData.SKRootDefinition.seq_no SKFormData.SKRootDefinition.job_pos SKFormData.SKRootDefinition.status_notes SKFormData.SKRootDefinition.check_privs SKFormData.SKRootDefinition.check_certs Variables.Event DateTIme Local*

*DateTime is set to workflow variable created to ensure that it is sent as localtime to the MES database.

Publishing the Form


Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec.StartJob form.

Testing the Workflow


Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.StartJob workflow.

Guide to Using ArchestrA Workflow with Wonderware MES

Starting a Job61

Sample Test Data and Expected Results


Two sets of sample test data that could be entered in the form, and the expected results in the MES database, are listed in the following table.
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

62 Chapter 4 Verifying Complex Event Types

Guide to Using ArchestrA Workflow with Wonderware MES

63

Chapter 5 Verifying DateTimes with Different Regional Settings

The following stateless API methods can be used from the MES - 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.

Prod.JobExec.CreateWoFromProcess, which creates a work order


from a process

Prod.JobExec.StartJob, which starts a job


Note: Other stateless API methods can also be used to verify this functionality.

Prerequisites for Performing the Tests


Two machines are necessary for these test processes:

The client machine should have Workflow and MES Client


installed. For this machine, use the Middleware Proxy Configuration Editor to change the Host Proxy to point to the second machine. Also, set the regional settings to Eastern Time.

The host machine should have MES Middleware and the MES
database installed. Set the regional settings to Pacific Time.

Guide to Using ArchestrA Workflow with Wonderware MES

64 Chapter 5 Verifying DateTimes with Different Regional Settings

Creating a Work Order from a Process


This test procedure calls the Prod.JobExec.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. 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.

Creating the Workflow


Perform the procedure in "Creating the Workflow" on page 14, with the following exceptions:

For the workflow title, use JobExec.CWFP. In the Generate Command window: For the stateless API, use JobExec.CreateWoFromProcess For the Generate Input XML Variable, use cwfp_input For the Generate Output XML Variable, use cwfp_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, use JobExec.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

Creating a Work Order from a Process65

Control Type
DateInput Number Number Number Button, 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, 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.CWFP workflow.

Adding Variables for the DateTime Inputs


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. For additional information about this issue, refer to "DateTime" on page 101. This test procedure includes Release Date/Time and Due Date/Time inputs in the workflow form. To address the DateTime issue for these inputs, 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.ToDateTime (XmlVariables.SFFormData.SKRootDefinition.release_time, System.Globalization.CultureInfo.InvariantCulture) .ToLocalTime()

Guide to Using ArchestrA Workflow with Wonderware MES

66 Chapter 5 Verifying DateTimes with Different Regional Settings

The variable Due DateTime Local of type date and with the
expression: Convert.ToDateTime (XmlVariables.SFFormData.SKRootDefinition.req_finish_time, System.Globalization.CultureInfo.InvariantCulture) .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.CWFP workflow variables to the JobExec.CWFP form controls, as listed in the following table.
Variable Form Control Name

XMLVariables.cwfp_input.request. item_id XMLVariables.cwfp_input.request. process_id XMLVariables.cwfp_input.request. spec_ver_id XMLVariables.cwfp_input.request. wo_id XMLVariables.cwfp_input.request. wo_desc XMLVariables.cwfp_input.request. user_id XMLVariables.cwfp_input.request. bom_ver_id XMLVariables.cwfp_input.request. release_time_local XMLVariables.cwfp_input.request. req_finish_time_local XMLVariables.cwfp_input.request. req_qty XMLVariables.cwfp_input.request. start_qty XMLVariables.cwfp_input.request. wo_priority

SKFormData.SKRootDefinition.item_id SKFormData.SKRootDefinition.process_id SKFormData.SKRootDefinition.spec_ver_id SKFormData.SKRootDefinition.wo_id SKFormData.SKRootDefinition.wo_desc SKFormData.SKRootDefinition.user_id SKFormData.SKRootDefinition.bom_ver_id Variables.Release DateTime Local* Variables.Due DateTime Local* SKFormData.SKRootDefinition.req_qty SKFormData.SKRootDefinition.start_qty SKFormData.SKRootDefinition.priority

* 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

Creating a Work Order from a Process67

Publishing the Form


Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec.CWFP form.

Testing the Workflow


Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.CWFP workflow.

Sample Test Data and Expected Results


Sample test data that could be entered in the form, and the expected results in the MES database, are listed in the following table.
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.A.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.A.1 11/01/2012 04:00:00 11/16/2012 14:00:00 40 50 2

Guide to Using ArchestrA Workflow with Wonderware MES

68 Chapter 5 Verifying DateTimes with Different Regional Settings

Starting a Job
This test procedure calls the Prod.JobExec.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 *, *_local, and *_utc fields. The process for creating the Start 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.

Creating the Workflow


Perform the procedure in "Creating the Workflow" on page 14, with the following exceptions:

For the workflow title, use JobExec.StartJob. In the Generate Command window: For the stateless API, use Prod.JobExec.StartJob For the Generate Input XML Variable, use startjob_input For the Generate Output XML Variable, 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, use JobExec.StartJob. 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

Starting a Job69

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.StartJob form to the JobExec.StartJob workflow.

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. For additional information about this issue, refer to "DateTime" on page 101. This test procedure includes an Event Time input in the workflow form. To address the DateTime issue for this input, 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.ToDateTime (XmlVariables.SFFormData.SKRootDefinition.event_time, System.Globalization.CultureInfo.InvariantCulture) .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.StartJob workflow variables to the JobExec.StartJob form controls, as listed in the following table.
Variable Form Control Name

XMLVariables.cwfp_input.request. ent_id XMLVariables.cwfp_input.request. user_id

SKFormData.SKRootDefinition.ent_id SKFormData.SKRootDefinition.user_id

*DateTime is set to workflow variable created to ensure that it is sent as localtime to the MES database.

Guide to Using ArchestrA Workflow with Wonderware MES

70 Chapter 5 Verifying DateTimes with Different Regional Settings

Variable

Form Control Name

XMLVariables.cwfp_input.request. wo_id XMLVariables.cwfp_input.request. oper_id XMLVariables.cwfp_input.request. seq_no XMLVariables.cwfp_input.request. job_pos XMLVariables.cwfp_input.request. status_notes XMLVariables.cwfp_input.request. check_privs XMLVariables.cwfp_input.request. check_certs XMLVariables.cwfp_input.request. event_time_local

SKFormData.SKRootDefinition.wo_id SKFormData.SKRootDefinition.oper_id SKFormData.SKRootDefinition.seq_no SKFormData.SKRootDefinition.job_pos SKFormData.SKRootDefinition.status_notes SKFormData.SKRootDefinition.check_privs SKFormData.SKRootDefinition.check_certs Variables.Event DateTime Local*

*DateTime is set to workflow variable created to ensure that it is sent as localtime to the MES database.

Publishing the Form


Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec.StartJob form.

Testing the Workflow


Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.StartJob workflow.

Sample Test Data and Expected Results


Sample test data that could be entered in the form, and the expected results in the MES database, are listed in the following table.
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

Starting a Job71

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

73

Chapter 6 Verifying Localization of Datatypes

The following stateless API methods can be used from the MES - Workflow Connector to verify that the localization of datatypes is being passed correctly from the Workflow to the MES database:

Prod.ItemClass.Add, which adds an item class Prod.JobExec.AddProd, which adds production to a job
Note: Other stateless API methods can also be used to verify this functionality.

Adding an Item ClassMES SQL Database


This test procedure calls the Prod.ItemClass.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. The process for creating the Add an Item Class test procedure is the same as that described in "Adding a Job" on page 13, with exceptions as noted in the following topics.

Guide to Using ArchestrA Workflow with Wonderware MES

74 Chapter 6 Verifying Localization of Datatypes

Creating the Workflow


Perform the procedure in "Creating the Workflow" on page 14, with the following exceptions:

For the workflow title, use ItemClass.Add. In the Generate Command window: For the stateless API, use Prod.ItemClass.Add For the Generate Input XML Variable, use itemclass_input For the Generate Output XML Variable, use itemclass_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, use ItemClass.Add. 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.Add form to the ItemClass.Add workflow.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding an Item ClassMES SQL Database75

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.Add workflow variables to the ItemClass.Add form controls, as listed in the following table.
Variable Form Control Name

XMLVariables.item_class_input.request. item_class_id XMLVariables.item_class_input.request. item_class_desc XMLVariables.item_class_input.request. produced XMLVariables.item_class_input.request. consumed XMLVariables.item_class_input.request. obsolete XMLVariables.item_class_input.request. purchased XMLVariables.item_class_input.request. sold

SKFormData.SKRootDefinition.item_class_id SKFormData.SKRootDefinition.item_class_desc SKFormData.SKRootDefinition.produced SKFormData.SKRootDefinition.consumed SKFormData.SKRootDefinition.obsolete SKFormData.SKRootDefinition.purchased SKFormData.SKRootDefinition.sold

Publishing the Form


Perform the procedure in "Publishing the Form" on page 31 to publish the ItemClass.Add form.

Testing the Workflow


Perform the procedure in "Testing the Workflow" on page 32 to test the ItemClass.Add workflow.

Sample Test Data and Expected Results


Sample test data for several languages that could be entered in the form, and the expected results in the MES database, are listed in the following tables.

Guide to Using ArchestrA Workflow with Wonderware MES

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 maana maana Yes (True) Yes (True) No (False) No (False) No False)

Clase de prueba maana maana 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

Catgorie de l'lment Catgorie de l'lment Yes (True) Yes (True) No (False) No (False) No (False)

Catgorie de l'lment Catgorie de l'lment True True False False False

Guide to Using ArchestrA Workflow with Wonderware MES

Adding a JobOracle Database77

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 JobOracle Database


This test procedure calls the Prod.Job.Add stateless API method to verify that strings that contain multi-byte characters (Chinese, Japanese, Russian) can be passed correctly from the MES - Workflow Connector and be recorded in an MES Oracle database that accepts multi-byte characters. The process for creating the Add an Job test procedure is the same as that described in "Adding a Job" on page 13, with exceptions as noted in the following topics.

Guide to Using ArchestrA Workflow with Wonderware MES

78 Chapter 6 Verifying Localization of Datatypes

Prerequisites for Performing This Test


For each language that uses multi-byte characters that you are testing, 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.


Note: This test will also work using an MES SQL database on an operating system in the multi-byte language being tested.

Creating the Workflow


Perform the procedure in "Creating the Workflow" on page 14, with the following exceptions:

For the workflow title, use Job.Add. In the Generate Command window: For the stateless API, use Prod.Job.Add For the Generate Input XML Variable, use jobadd_input For the Generate Output XML Variable, 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, use Job.Add. 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

Adding a JobOracle Database79

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.Add form to the Job.Add workflow.

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. For additional information about this issue, refer to "DateTime" on page 101. This test procedure includes a Required Finish Date/Time input in the workflow form. To address the DateTime issue for this input, 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.ToDateTime (XmlVariables.SFFormData.SKRootDefinition.req_finish_time_ local,System.Globalization.CultureInfo.InvariantCulture) .ToLocalTime()

Guide to Using ArchestrA Workflow with Wonderware MES

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.Add workflow variables to the Job.Add form controls, as listed in the following table.
Variables Form Control Name

XMLVariables.jobadd_input.request. wo_id XMLVariables. jobadd _input.request. oper_id XMLVariables. jobadd _input.request. seq_no XMLVariables.jobadd_input.request. req_finish_time_local XMLVariables.jobadd_input.request. rework XMLVariables.jobadd_input.request. init_sched_ent_id XMLVariables.jobadd_input.request. target_sched_ent_id XMLVariables.jobadd_input.request. req_qty XMLVariables.jobadd_input.request. start_qty XMLVariables.jobadd_input.request. spare1 XMLVariables.jobadd_input.request. last_edit_comment XMLVariables.jobadd_input.request. item_id XMLVariables.jobadd_input.request. est_prod_rate

SKFormData.SKRootDefinition.wo_id SKFormData.SKRootDefinition.oper_id SKFormData.SKRootDefinition.seq_no Variables.RequiredFinish DateTime Local* SKFormData.SKRootDefinition.rework SKFormData.SKRootDefinition.init_sched_ent_ id SKFormData.SKRootDefinition.target_sched_ ent_id SKFormData.SKRootDefinition.req_qty SKFormData.SKRootDefinition.start_qty 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.

Publishing the Form


Perform the procedure in "Publishing the Form" on page 31 to publish the Job.Add form.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding a JobOracle Database81

Testing the Workflow


Perform the procedure in "Testing the Workflow" on page 32 to test the Job.Add workflow.

Sample Test Data and Expected Results


Sample test data for Chinese, Russian, and Japanese that could be entered in the form, and the expected results in the MES database, are listed in the following tables.

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.12345 1234567890123.12345 No (False) QA-Case24 1234567890123.12345

Wo1 12345 10/26/2012 15:16:17 15 15 1234567890123.12 1234567890123.12 0 QA-Case24 1234567890123.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

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.12345 No (False) QA-Case24 1234567890123.12345

15 1234567890123.12 1234567890123.12 0 QA-Case24 1234567890123.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.12345 1234567890123.12345 No (False) QA-Case24 1234567890123.12345

Wo1 12345 10/26/2012 15:16:17 15 15 1234567890123.12 1234567890123.12 0 QA-Case24 1234567890123.12

Guide to Using ArchestrA Workflow with Wonderware MES

Adding Production to a Job83

Adding Production to a Job


This test procedure calls the Prod.JobExec.AddProd stateless API method to verify that strings of different DateTime formats can be passed correctly from the MES - Workflow Connector and be recorded in the MES database. 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, with exceptions as noted in the following topics.

Creating the Workflow


Perform the procedure in "Creating the Workflow" on page 14, with the following exceptions:

For the workflow title, use JobExec.AddProd. In the Generate Command window: For the stateless API, use Prod.JobExec.AddProd For the Generate Input XML Variable, use addprod_input For the Generate Output XML Variable, use addprod_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, use JobExec.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

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.AddProd form to the JobExec.AddProd workflow.

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. For additional information about this issue, refer to "DateTime" on page 101. This test procedure includes an Event Time input in the workflow form. To address the DateTime issue for this input, 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.ToDateTime (XmlVariables.SFFormData.SKRootDefinition.event_time, System.Globalization.CultureInfo.InvariantCulture) .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.AddProd workflow variables to the JobExec.AddProd form controls, as listed in the following table.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding Production to a Job85

Variables

Form Control Name

XMLVariables.addprod_input.request. session_id XMLVariables.add_prod_input.request. event_time_local XMLVariables.addprod_input.request. user_id XMLVariables.addprod_input.request. ent_id XMLVariables.addprod_input.request. qty_prod XMLVariables.addprod_input.request. reas_cd XMLVariables.addprod_input.request. lot_no XMLVariables.addprod_input.request. sublot_no XMLVariables.addprod_input.request. storage_ent_id XMLVariables.addprod_input.request. item_id XMLVariables.addprod_input.request. bom_pos XMLVariables.addprod_input.request. seg_req_id XMLVariables.addprod_input.request. seg_res_id XMLVariables.addprod_input.request. job_pos

SKFormData.SKRootDefinition.session_id Variables.Event DateTime Local* SKFormData.SKRootDefinition.user_id SKFormData.SKRootDefinition.ent_id SKFormData.SKRootDefinition.qty_prod SKFormData.SKRootDefinition.reas_cd SKFormData.SKRootDefinition.lot_no SKFormData.SKRootDefinition.sublot_no SKFormData.SKRootDefinition.storage_ent_id SKFormData.SKRootDefinition.item_id SKFormData.SKRootDefinition.bom_pos SKFormData.SKRootDefinition.seg_req_id SKFormData.SKRootDefinition.seg_res_id SKFormData.SKRootDefinition.job_pos

*DateTime is set to a workflow variable created to ensure that it is sent as localtime to the MES database.

Guide to Using ArchestrA Workflow with Wonderware MES

86 Chapter 6 Verifying Localization of Datatypes

Publishing the Form


Perform the procedure in "Publishing the Form" on page 31 to publish the JobExec.AddProd form.

Testing the Workflow


Perform the procedure in "Testing the Workflow" on page 32 to test the JobExec.AddProd workflow.

Sample Test Data and Expected Results


Sample test data that could be entered in the form for various DateTime formats, and the expected results in the MES database, are listed in the following tables.

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

Guide to Using ArchestrA Workflow with Wonderware MES

Adding Production to a Job87

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

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

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

DateTime Format 4

Date Format: dd.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.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

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.ItemClass.Add, which adds an item class Prod.JobExec.CreateWoFromProcess, which creates a work order
from a process
Note: Other stateless API methods can also be used to verify this functionality.

Guide to Using ArchestrA Workflow with Wonderware MES

90 Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow

Adding an Item Class


This test procedure calls the Prod.ItemClass.Add stateless API method to verify that the data of an MES activity is correctly passed to the MES Workflow.

Creating the MES Event


You have to create a Prod.ItemClass.Add event for this test procedure.
To create the MES event 1 2

Open MES Workflow Event Creator. In the box at the upper left, enter Prod.ItemClass. A list of stateless APIs that match the entry appears.

3 4

In the list, click Prod.ItemClass.Add. Click the Process button. The parameter grid appears.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding an Item Class91

In the parameter grid lists, select item_class_id, then item_class_desc, and then produced.

Click the Provision events in all connected Workflow Repositories button. A message appears that confirms the successful provisioning of the event. Click OK to close the message. Click the Provision Post Hook button. A message appears that confirms the successful provisioning of the event, and indicating that the MES Middleware services need to be restarted. Click OK to close the message. MES Middleware Host and MES Service.

7 8

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, log in to the ArchestrA Workflow Softwares Enterprise Console as an MES user. On the Enterprise Console menu, click Workflows. The Workflows window appears.

Guide to Using ArchestrA Workflow with Wonderware MES

92 Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow

On the Ribbon, click the MES workflow icon. A New MES Workflow window appears.

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.g., ItemClass.Add). A description of the workflow. Select the environment name (e.g., MESDB_MES). Select the MES Middleware connection (e.g., mes40). Select the event that was created, Prod.ItemClass.Add Select Post Hook. Type item_class.

Click Next and then click Save & Continue. The Workflow Options window appears. The option on the workflow tasks defaults to Design the workflow now.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding an Item Class93

6 7 8

Click Finish. A workflow window appears. It includes a Start activity by default. In the Activities list, click Human Activities. Click and drag the Information activity onto the window to the right of the Start activity.

On the tool bar, click the Link icon and create a link from the Start activity to the Information1 activity.

10 Right-click the Information1 activity and click Activity Properties.

Guide to Using ArchestrA Workflow with Wonderware MES

94 Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow

11 In the Actors section of the Activity Properties pane, click the


Assign Actor(s) box button. The Assign Actor(s) window appears.

12 Click the User option. The User Lookup window appears. 13 In the list at the upper right, select MES Users. 14 In the search box, type an MES user and select
user_name.user_id in the list.

15 Click Search. The user appears in the Available Resources box.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding an Item Class95

16 Select the user and click the right arrow button to add the user to

the Selected Resources box.

17 Click Update. The user appears in the Assign Actor(s) window.

18 Click Update to save the assigned actor and close the Assign
Actor(s) window.

19 In the Notification Contents section of the Activity Properties

pane, click the Subject box button. The Subject window appears.
20 In the main box, type New Item Class Created and press

ENTER.

21 In the first field list, select XML Variables. 22 In the second field list, select MESEventData.

Guide to Using ArchestrA Workflow with Wonderware MES

96 Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow

23 Click the third lists button. A tree of available XML variables

appears.

24 Click the item_class_id variable. The tree closes and the variable

is entered in the third list.


25 Press ENTER to create a new line and then click the Append

button. The variable is added to the main box.

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.

Guide to Using ArchestrA Workflow with Wonderware MES

Adding an Item Class97

28 Select and append the item_class_id, item_class_description, and

produced variables from the MESSPHookXmlData tree, just as you did for the three MESEventData variables.

29 Click the Update button. The Subject window closes. 30 At the bottom of the Activity Properties pane, click Save and close

the workflow window.


31 In the Workflows window, right-click the ItemClass.Add workflow

and click Publish. A message appears indicating the status of the publish operation.
32 Click Close to close the message.

Starting the Workflow


To start the workflow 1 2 3 4 5 6 7

Log in to MES Client. Click Production Definition. Click Item Classes. Right-click the Item Class grid and click New. An new item class row appears in the grid. Type the item class ID and description. Select the Produced check box. Save the new item class.

Verifying the Data


To verify the data 1 2

From Internet Explorer, log in to the ArchestrA Workflow Softwares Enterprise Console as an MES user. On the Enterprise Console menu, click Dashboard. The Dashboard window appears.

Guide to Using ArchestrA Workflow with Wonderware MES

98 Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow

Open the inbox information for the MES workflow you created with a Subject of New Item Class Created. The data in the body of the email should show the item_class_id, item_class_desc, and produced value for the values coming into the event, and the item_class_id, item_class_desc, and produced value for the values being sent into the Post Hook. They should agree with the values entered in MES Client when creating the item class.

Sample Test Data and Expected Results


Sample test data and the expected results in MESEventData and MESSPHookData are listed in the following table.
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.JobExec.CreateWoFromProcess stateless API method to verify that data with dates correctly passed from the MES Middleware to the MES - Workflow Connector. 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, with exceptions as noted in the following topics.

Creating the MES Event


Perform the procedure in "Creating the MES Event" on page 90, with the following exceptions:

In MES Workflow Event Creator, select


Prod.JobExec.CreateWoFromProcess as the stateless API for the

event.

In the parameter grid lists, select wo_id, then release_time, and


then req_finish_time.

Guide to Using ArchestrA Workflow with Wonderware MES

Creating a Work Order from a Process99

Creating the Workflow


Perform the procedure in "Creating the Workflow" on page 91, 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.

The workflow title (e.g., JobExec.CWFP). A description of the workflow. Select the environment name (e.g., MESDB_MES). Select the MES Middleware connection (e.g., mes40). Select the event that was created, Prod. JobExec.CreateWoFromProcess. Select Post Hook. Type job_exec.

In the Subject window, in the first line of the main box, type New In the Subject window main box, append the following XML
variables:

MESEventData: request.wo_id MESEventData: request.release_time MESEventData: request.req_finish_time MESSPHookData: request.wo_id MESSPHookeData: request.release_time MESSHookData: request.req_finish_time

Starting the Workflow


To start the workflow 1 2 3 4 5

Log in to MES Client. Click Production Definition. Click Process Extension. Click Apply Filters. Right-click one of the processes and click Create Work Order.

Guide to Using ArchestrA Workflow with Wonderware MES

100 Chapter 7 Verifying Data Passing from Wonderware MES to an ArchestrA Workflow

6 7

Enter the wo_id, the required quantity, the start quantity, the release date/time, and the due date/time. Click OK.

Verifying the Data


To verify the data 1 2 3

From Internet Explorer, log in to the ArchestrA Workflow Softwares Enterprise Console as an MES user. On the Enterprise Console menu, click Dashboard. The Dashboard window appears. Open the inbox information for the MES workflow you created with a Subject of New WO Created. The data in the body of the email should show the wo_id, release_time, and req_finish_time value for the values coming into the event, and wo_id, release_time, and req_finish_time value for the values being sent into the Post Hook. They should agree with the values entered in MES Client when creating the work order from the process.

Sample Test Data and Expected Results


Sample test data and the expected results in MESEventData and MESSPHookData are listed in the following table.
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

101

Appendix A Potential Issues and Resolutions

When executing the test procedures, certain issues can occur. These issues and their resolutions are addressed here.

DateTime
By default, ArchestrA Workflow Software converts any time inputs in a workflow form to UTC time. However, 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. For example, if 6a PDT is entered in the workflow form, it is converted to UTC time and passed as 1p to the MES stateless API method. The time is then incorrectly recorded in the MES database as 1p local time and 8p UTC time. To avoid this issue, you must:

Create a DateTime variable in the Start activity for each DateTime


variable in the MES XML.

Convert the input value from the workflow form for each time
DateTime variable from UTC time to local time.

Have the DateTime variables in MES receive values from these


internal variables. This resolution is demonstrated in the example procedures in this document. Following is a general description of the resolution.

Guide to Using ArchestrA Workflow with Wonderware MES

102 Appendix A Potential Issues and Resolutions

First, include form controls for the DateTime variables in the Workflow form, as shown in the following example. The entries for these fields will be sent as parameters to the MES stateless API.

Next, create a DateTime variable for the Start activity.


To create a DateTime variable for a Start activity 1 2 3

With the workflow opened, right-click the Start activity and click Activity Properties. The Activity Properties pane appears. On the Activity Properties pane, click the Variables box button. The Variables window appears. In the Workflow Variables box, enter a name for the DateTime variable.

Guide to Using ArchestrA Workflow with Wonderware MES

DateTime103

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.

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 Settings105

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

106 Appendix A Potential Issues and Resolutions

Class Arrays in the List of Parameters


When the stateless API methods contain class arrays (e.g., InvTransferSource[ ] sourceList in EnProd.StorageExec.MoveInventory method, ExtendedAttribute [ ] extendedAttrs in Prod.JobExec.AddPEMData, etc.), those methods are not exposed/accessible in MES - Workflow Connector. MES - Workflow Connector ignores the methods that contain class arrays. Therefore, these methods are not tested from MES - Workflow Connector.

Intermittent Failures on Reporting Status


When testing maximum amounts, such as with JobExec.StartJob, on a slow system, there is no indication given in Workflow after MESXMLCommand is finished. When the bandwidth for the VPN caused it to run slowly, attempting to start a job took awhile. There was no indication given in the executing or waiting events in Workflow. It was later found using MES Client that the job was started, but a Completed message was never received in workflow.

Guide to Using ArchestrA Workflow with Wonderware MES

107

Index

A
adding a job 13, 77 adding an attribute 35 adding an item class 40, 73, 90 adding production to a job 49, 83 ArchestrA Workflow form, binding to workflow 21 form, creating 18 form, publishing 31 linking variables to form controls 26 logging in 12 users, configuring 12 workflow, publishing 30 workflow, testing 32 ArchestrA Workflow Repository database, configuring 12 asynchronous methods 105 attribute, adding 35

DateTimes testing with different regional settings 63 UTC/local time issue 101 document conventions 10

E
event types, testing 55

F
form controls, linking to workflow variables 26 forms binding to workflow 21 creating 18 publishing 31

I
item class, adding 40, 73, 90

C
class arrays 106 creating a work order 42, 64, 98

J
job adding 13, 77 adding production to 49, 83 setting lot information for 55 starting 46, 58, 68

D
datatypes, testing localization of 73

Guide to Using ArchestrA Workflow with Wonderware MES

108Index

L
local time/UTC issue with DateTime inputs 101 localization of datatypes, testing 73 lot information, setting for a job 55

M
MES - Workflow Connector, configuring 12 MES quality modules 105 MES users, 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, creating 42, 64, 98 workarounds to test procedure issues 101 workflows creating 14 linking variables to form controls 26 publishing 30 testing 32

S
setup, initial 12 Start activity, adding a variable to 23 starting a job 46, 58, 68

T
technical support 10

Guide to Using ArchestrA Workflow with Wonderware MES

You might also like