Understanding and Using Control Numbers in Software AG webMethods.io B2B
Tags: integration, edi, tutorial
Published: 2021-10-01 13:57:29

---
title: Understanding and Using Control Numbers in Software AG webMethods.io B2B
published: true
date: 2021-01-28 10:45:37 UTC
tags: #integration, #edi, #tutorial 
canonical_url: https://tech.forums.softwareag.com/t/understanding-and-using-control-numbers/238346/1
---

## Before You Begin

- You must have a basic understanding of [webMethods.io](http://webMethods.io) B2B and its related components like the user interface.
- You must have a basic understanding of [webMethods.io](http://webMethods.io) Integration FlowServices and knowledge of creating integrations using various applications.
- You must have a fully functional [webMethods.io](http://webMethods.io) B2B product instance with the required B2B assets such as channels, partner profiles, business documents, and processing rules.
- You must have an inbound document coming in from a trading partner to submit to the [webMethods.io](http://webMethods.io) B2B product instance.
- You must access the latest [webMethods.io](http://webMethods.io) Integration and [webMethods.io](http://webMethods.io) B2B product instances.
- You must create an account for the [webMethods.io](http://webMethods.io) B2B application on [webMethods.io](http://webMethods.io) Integration so you can connect to the [webMethods.io](http://webMethods.io) B2B product instance.
- For the successful completion of the use case, ensure that all the B2B assets you create on the [webMethods.io](http://webMethods.io) Integration and [webMethods.io](http://webMethods.io) B2B product instances are in enabled state.

## What is a Control Number?

Control Number is used in the EDI standards ANSI X12, UN/EDIFACT, and VDA. It refers to a number in the header of an EDI document that is used for validation and for the ordering of documents exchanged between trading partners. If you use the TRADACOMS EDI standard, the term control number is equivalent to the transmission reference numbers specified in the STX and BAT segments of your TRADACOMS documents. Whether your EDI standard includes control numbers or transmission reference numbers, you define them in [webMethods.io](http://webMethods.io) B2B in the same way; the only difference is in the terminology.

Control number is a sequential number which is used in EDI messages. It is not necessarily a unique number. You can define a window in which you accept this number and use this window range to detect duplicates or out of sequence messages. This is called a control number window.

## What Can I Do with Control Numbers in [webMethods.io](http://webMethods.io) B2B ?

[webMethods.io](http://webMethods.io) B2B allows you to define control numbers for outbound EDI messages with your partners.

## Where Do I Define Control Numbers?

**From Partners menu:**

Go to Partners > Partner profiles > Choose a specific partner > Control numbers > Add Control number

You can define the control number with the chosen partner as a sender or receiver and configure the rest of the parameters and control number window settings.

**From Settings:**

Go to Settings > Control numbers > Add Control number

You can define the control number with the necessary parameters and control number window settings.

How are Control Numbers Applied in an EDI Message?

Control numbers in an EDI message are applicable for Envelope, Group and Transactions. It varies in different EDI standards though.

For eg, in the below X12 sample, 000000001 _is the Envelope control number, 11464 is the group control number , 000511461 is the transaction control number._

```
ISA*00* *00* *01*100000007 *01*110000007 *031008*1040*U*00401*000000001*1*P*>~
GS*IN*100000007*110000007*20030627*1304*11464*X*004010~
ST*810*000511461~
--
--
--
SE*29*000511461~
GE*1*11464~
IEA*1*000000001~

```

## Classification of Control Numbers in [webMethods.io](http://webMethods.io) B2B

### Control Numbers for Envelope and Group

You can define the control numbers for an Envelope and Group uniquely with a combination of sender, receiver, standard, version, group and mode. It makes sense to use these parameters as they are all part of Envelope and Group segments.

You can do this in the first section in the Control numbers page as shown below:

![1](https://aws1.discourse-cdn.com/techcommunity/original/2X/8/8eb760e07dcf881d3dbd56c99233520773a00075.png)

### Control Numbers for Transactions

Since transaction segments (such as _ST~850~114640004!_ ) do not have any parameters, it is defined globally by [webMethods.io](http://webMethods.io) B2B. But you can change the control number window settings page as shown below:

![2](https://aws1.discourse-cdn.com/techcommunity/original/2X/5/5dcfc204f6844a67e31ee14dc5c9acd531190547.png)

## Using the Control Numbers Definitions in a FlowService While Constructing Outbound EDI Messages

The flow service uses the predefined operations defined in the [webMethods.io](http://webMethods.io) B2B application. The business flow service resides on [webMethods.io](http://webMethods.io) Integration. The integration input pipeline for this recipe is pre-loaded with the input signature needed to interpret a transaction request payload coming from a [webMethods.io](http://webMethods.io) B2B product instance, and the output pipeline is constructed with the signature that the [webMethods.io](http://webMethods.io) B2B product instance understands.

The use case starts when an inbound document arrives from a specific sender in [webMethods.io](http://webMethods.io) B2B and the corresponding integration is invoked through a processing rule. The use case ends when you see the control number being updated in the **Content** page of [webMethods.io](http://webMethods.io) B2B product instance. In case an integration fails to execute successfully, the integration returns an appropriate error to the [webMethods.io](http://webMethods.io) B2B product instance.

### Workflow

[![3](https://aws1.discourse-cdn.com/techcommunity/original/2X/3/3857b2a171ea84e461bf78634e4d62fe6524d021.png)](https://aws1.discourse-cdn.com/techcommunity/original/2X/3/3857b2a171ea84e461bf78634e4d62fe6524d021.png "3")

### Interpreting Control Number Parameters

You can write a flow service in [webMethods.io](http://webMethods.io) Integration and use the ‘getControlNumber’ operation from [webMethods.io](http://webMethods.io) B2B Application. This operation retrieves the control number of an envelope, group, or transaction depending on the segment you construct in the FlowService.

#### To fetch the control number for a transaction segment in a FlowService:

Set the _type_ parameter to ‘transaction’ in the getControlNumber operation in the FlowService of [webMethods.io](http://webMethods.io) Integration.

#### To fetch control number for a Group/Envelope segment in a FlowService:

Set the following parameters in the getControlNumber operation in the FlowService of [webMethods.io](http://webMethods.io) Integration.

| **Input parameter of getControlNumber operation** | **Corresponding Field Name in webMethods.io B2B Control number definition** |
| ------ | ------ |
| type | The value can be group value set in the control number definition. Possible values are: envelope, all, or any custom group identifier. For example, ANSI X12 4010 850 corresponds to a PO. ![table1](https://aws1.discourse-cdn.com/techcommunity/original/2X/9/9e883a902fad28930bca9bf750c28b1ce00ad098.png) |
| scope/senderIdentityValue | External ID of the Sender which is configured in the control number definition. For example, if for the sender Orange\_sender, the identifier is 123456789, use this value for scope/senderIdentityValue ![table2](https://aws1.discourse-cdn.com/techcommunity/original/2X/4/434292c6744ebd7e3e650b9e13cb293f502664b7.png) |
| scope/senderQualifier | External Id type of the Sender which is configured in the control number definition. For example, if for the sender Orange\_sender, the identifier type is DUNS (01), use this value(01) for scope/senderQualifier ![table3](https://aws1.discourse-cdn.com/techcommunity/original/2X/8/80fdb88709468fc97e99a9f94cae903fa7475104.png) |
| scope/receiverIdentityValue | External Id of the Sender which is configured in the control number definition.For example, if for the sender Orange\_receiver, the identifier is 987654321, use this value for scope/receiverIdentityValue ![table4](https://aws1.discourse-cdn.com/techcommunity/original/2X/4/467e4df0047fa749aabcf5414218325e640673e1.png) |
| scope/receiverQualifier | External Id type of the receiver which is configured in the control number definition. For example, if for the receiver Orange\_receiver, the identifier type is DUNS (01), use this value(01) for scope/receiverQualifier ![table5](https://aws1.discourse-cdn.com/techcommunity/original/2X/2/2edda015841fa9e9c80bfd42e525b181ae60ea65.png) |
| Standard | ![table6](https://aws1.discourse-cdn.com/techcommunity/original/2X/f/f9fc86640c705f1cbc1b1caf2de0e877d3997841.png)|
| Mode | ![table7](https://aws1.discourse-cdn.com/techcommunity/original/2X/0/027ce64f1d142f7d36188356f15d85b366ed8676.png)|
| Version | ![table8](https://aws1.discourse-cdn.com/techcommunity/original/2X/1/10dffc9ba095e2972eea2110d38afc23023ca181.png)|

### Including Control Numbers in Outbound EDI Business Documents Using [webMethods.io](http://webMethods.io) Integration FlowService Recipe

1. On the [webMethods.io](http://webMethods.io) Integration product instance, open your project, switch to the **FlowServices** tab.
2. Type a name for your integration along with a description, and click **Finish**.

The following image shows you an example of how the flow service must be constructed:

![4](https://aws1.discourse-cdn.com/techcommunity/original/2X/d/d6991315b6cbb8503804d06aa16f4b1cc69ad991.png)

Step 1: Accept and process the envelope of an X12 document and convert the envelope header to a document:

Step 2: Retrieve the control number of the document from [webMethods.io](http://webMethods.io) B2B

Step 3: Convert the document to an EDI message

Step 4: Retrieve the control number for IN group type from the [webMethods.io](http://webMethods.io) B2B product instance

Step 5: Add group header to the X12 EDI message

Step 6: Retrieve the control number of the envelope from the [webMethods.io](http://webMethods.io) B2B product instance

Step 7: Add the envelope header to the X12 EDI message

Step 8: Submit the X12 document to the [webMethods.io](http://webMethods.io) B2B product instance

### Next Steps

#### Verify the control numbers in my outbound transactions

Go to Transactions in [webMethods.io](http://webMethods.io) B2B > Choose the outbound transaction > Attributes > Check for the value in the attribute ‘Document ID’

This is the transaction control number which is present in the transaction segment of the EDI message illustrated above.

![5](https://aws1.discourse-cdn.com/techcommunity/original/2X/4/46b51ded29df1a0d6f85cd37e6daf95c43f3809b.png)

### Alternate Flow

Similarly, the TRADACOMS FlowService can be constructed as the example shown below:

![6](https://aws1.discourse-cdn.com/techcommunity/original/2X/6/6ee52152b93f21bdad396d32ed3e2261bafa1fc5.png)

[Read full topic](https://tech.forums.softwareag.com/t/understanding-and-using-control-numbers/238346/1)