Use Anypoint Studio to Configure X12 EDI Connector 2.17 | MuleSoft Documentation
# Use Anypoint Studio to Configure X12 EDI Connector 2.17
Anypoint Studio (Studio) editors help you design and update your Mule applications, properties, and configuration files.
To add and configure a connector in Studio:
  1. Create a Mule project.
  2. Add the connector to your Mule project.
  3. Configure an input source for the connector’s flow.
  4. Add a connector operation to the flow.
  5. Configure a global element for the connector.
  6. Configure the other connector fields.


You must change the default Anypoint configuration to use X12 Connector 2.x.
## Increasing Anypoint Studio 7.x Memory
If more than the standard memory configuration is required to use Anypoint Studio 7.1.0 and later with X12 Connector 2.x, then you’ll need to change the memory setting for Studio.
Set the Anypoint Studio memory to 4 GB, as this is sufficient for the most common uses of this connector.
  1. Edit the `Anypoint.ini` file in the Anypoint Studio installation directory and change the two lines starting with `-Xms` and `-Xmx` to:


```
-Xms4096m
-Xmx4096m
```

If you are new to configuring connectors in Studio, see Use Studio to Configure a Connector. If, after reading this topic, you need additional information about the connector fields, see the X12 EDI Reference.
## Create a Mule Project
In Studio, create a new Mule project in which to add and configure the connector:
  1. In Studio, select **File > New > Mule Project**.
  2. Enter a name for your Mule project and click **Finish**.


## Add the Connector to Your Mule Project
Add X12 EDI (X12 Connector) to your Mule project to automatically populate the XML code with the connector’s namespace and schema location and add the required dependencies to the project’s `pom.xml` file:
  1. In the **Mule Palette** view, click **(X) Search in Exchange**.
  2. In **Add Modules to Project** , type `X12 EDI` in the search field.
  3. Click X12 Connector in **Available modules**.
  4. Click **Add**.
  5. Click **Finish**.


Adding a connector to a Mule project in Studio does not make that connector available to other projects in your Studio workspace.
## Configure a Source
A source initiates a flow when a specified condition is met. You can configure this source to use with X12 EDI Connector:
  * HTTP Listener Initiates a flow each time it receives a request on the configured host and port.


For example, to configure an HTTP Listener source, follow these steps:
  1. In the **Mule Palette** view, select **HTTP > Listener**.
  2. Drag **Listener** to the Studio canvas.
  3. On the **Listener** configuration screen, optionally change the value of the **Display Name** field.
  4. Specify a value for the **Path** field.
  5. Click the plus sign (**+**) next to the **Connector configuration** field to configure a global element that can be used by all instances of the HTTP Listener source in the app.
  6. On the **General** tab, specify connection information for the connector.
  7. On the **TLS** tab, optionally specify the TLS information for the connector.
  8. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy.
  9. Click **Test Connection** to confirm that Mule can connect with the specified server.
  10. Click **OK**.


## Add a Connector Operation to the Flow
When you add a connector operation to your flow, you are specifying an action for that connector to perform.
To add an operation for X12 EDI Connector, follow these steps:
  1. In the **Mule Palette** view, select **X12 EDI** and then select the desired operation.
  2. Drag the operation onto the Studio canvas to the right of the input source.


## Configure a Global Element for the Connector
When you configure a connector, configure a global element that all instances of that connector in the app can use. Configuring a global element requires you to provide the authentication credentials that the connector requires to access the target X12 EDI system.
To configure the global element for X12 EDI (X12 EDI Connector), follow these steps:
  1. Select the name of the connector in the Studio canvas.
  2. In the configuration screen for the operation, click the plus sign (**+**) next to the **Connector configuration** field to access the global element configuration fields.


You can reference a configuration file that contains ANT-style property placeholders (recommended), or you can enter your authorization credentials in the global configuration properties.
For information about the benefits of using property placeholders and how to configure them, see Anypoint Connector Configuration.
  1. On the **Advanced** tab, optionally specify reconnection information, including a reconnection strategy.
  2. Click **Test Connection** to confirm that Mule can connect with the specified server.
  3. Click **OK**.


## Configure Additional Connector Fields
After you configure a global element for X12 EDI (X12 EDI Connector), configure the other required fields for the connector.
### General Tab
Use the **General** tab to configure settings for reading and writing X12 messages.
To use the Functional Acknowledgment schema type (997 or 999) it must match the **Generate 999 Functional Acknowledgments** setting on the **Parser** tab (`false` for 997, `true` for 999).   
---  
Field | Description  
---|---  
Form and validation | X12 form and validation (standard X12, HIPAA SNIP Type 1, or HIPAA SNIP Type 2)  
Schema definitions | Manually create or edit the list of schema definitions for the message structures to use. They all need to use the same form (either X12 or HIPAA).  
Character encoding | X12 character encoding, used for both send and receive messages  
Character set | X12 character set allowed in string data (BASIC, EXTENDED, or UNRESTRICTED)  
Substitution character | String substitution character, used to replace invalid characters in string data  
Version identifier suffix | Version identifier code suffix, specifying a value appended to the base schema version in the GS08 Version / Release / Industry Identifier Code field  
### Identity Tab
Use the **Identity** tab to configure the Interchange Control Header (ISA) and Functional Group Header (GS) identifier values for you and your trading partner in X12 Connector configuration. If configured, then the values are verified when reading an input message and used as the defaults when writing an output message (if no value output data is specified).
You can set the values for the:
  * Interchange ID qualifier and Interchange ID for your Mule application and partner
  * Application Code for Mule and partner
The Mule values specify the Receiver fields (ISA07/ISA08, GS03) in a receive message and populate the Sender fields (ISA05/ISA06, GS02) fields in a send message.
### Parser Tab
You can set the following options to control parser validation of receive messages if needed. Changing these options from the default setting of true interferes with HIPAA SNIP Type 1 and Type 2 validation of messages. Use these options with standard X12 data, not with HIPAA.
Field | Description  
---|---  
Enforce length limits | Enforce minimum and maximum lengths for receive values  
Enforce character set | Enforce allowed character set  
Enforce value repeats | Enforce repetition count limits for receive values  
Allow unknown segments | Allow unknown segments in a transaction set  
Enforce segment order | Enforce segment order in a transaction set  
Allow unused segments | Allow segments marked as Unused in a transaction set  
Enforce segment repeats | Enforce segment repetition count limits in a transaction set  
Require unique interchanges | Require unique ISA Interchange Control Numbers (ISA13)  
Require unique groups | Enforce globally unique Group Control Numbers (GS06) for received functional groups  
Require unique transactions | Enforce globally unique Transaction Set Control Numbers (ST02) for received transaction sets  
Store time-to-live | Set the minimum number of days to store interchange, group, and transaction set numbers for checking uniqueness  
Acknowledge every transaction | Include a separate AK2/AK5 (997) or AK2/IK5 (999) acknowledgment for every received transaction set. Instead of using implicit acknowledgments for transaction sets without errors  
Generate 999 acknowledgments | Generate 999 Implementation Acknowledgments, rather than the 997 Functional Acknowledgments default. The support for 999 Implementation Acknowledgments does not include CTX segment generation.  
Report segment details | Report segment error details to sender in the generated 997 or 999 acknowledgments  
Include Acknowledgement schema | Automatically include a standard 997 or 999 schema that matches the generated acknowledgment in the configuration for received messages  
Acknowledgment schema path | Set the path to a Functional Acknowledgment schema to be used for generated acknowledgments such as `/hipaa/005010X231A1/999.esl`, that uses the standard HIPAA 005010X231A1 acknowledgment. The schema type included in the path must match the Generate 999 Functional Acknowledgments setting (`false` for 997, `true` for 999). If you do not set the path, the parser uses a hardcoded X12 997 or 999 schema, as appropriate.  
Enforce conditional rules | Enforce conditional rules for receive values  
### Writer Tab
Writer options let you specify the separator characters used when writing messages.
Field | Description  
---|---  
Data element separator | Specify characters when writing messages  
Component element separator | Specify characters when writing messages  
Repetition separator | Specify characters when writing messages  
Segment terminator | Specify characters when writing messages  
Segment line ending | Line ending written between segments, used to make the output more readable  
Unique group numbers | Whether to generate unique GS group control numbers across interchanges  
Unique transaction numbers | Whether to generate unique ST transaction set control numbers across groups and interchanges  
Implementation reference | An implementation convention reference (ST03) value  
Initial interchange number | The starting interchange control number. Only used when no current value is found in the object store  
Initial group number | The starting group control number. Only used when no current value is found in the object store  
Initial transaction number | The starting transaction set control number. Only used when no current value is found in the object store  
Request acknowledgments | Whether to request interchange acknowledgments (ISA14)  
Default usage indicator | The default interchange usage indicator (ISA15). Used when no value is present in the message data  
Use supplied values | Whether to use supplied values for control segment information (control numbers, in particular). The default behavior is always generate control numbers when writing. This allows you to use chosen values  
Output mime type | Whether to use the default output MIME type `application/plain`, or the X12-specific alternative `application/edi-x12`.  
Enforce length limits | Whether to enforce length limits on input data  
Enforce conditional rules | Whether to enforce conditional rules on input data. The default is to ignore conditional rules  
Interchange number key | The key-value pair of the interchange control key and interchange control number  
Group number key | The key-value pair of group control key and group control number  
Transaction number key | The key-value pair of the transaction control key and transaction control number  
## Next Step
After you configure a global element and connection information, configure the other fields for the connector. See Additional Configuration Information for more configuration steps.
## See Also
  * Introduction to Anypoint Connectors
  * MuleSoft Help Center