Generating Helper Classes for Consumer

To generate the helper classes

  1. Load the XSD Schema into the DDW.

  2. On the Schema View, right-click the XSD schema.

  3. Select Generate Helper Classes for Consumer.

    The Generate Helper Classes for Consumer window appears.

  4. Select the language of the helper class. Currently, DDW can generate Java and C# classes.

  5. Click Browse, and select or create a directory.

  6. Click OK.

    A helper class is generated for every XSD element (including the embedded elements) present in the XSD schema and the top DEKafkaMessage class. After the classes are created, the directory containing the helper class opens.

Example of the generated Java Helper class for the Table EVENT (not all values are shown) is as follows:

package DE.Kafka;
import java.math.BigDecimal;
import java.util.ArrayList;

public class EVENT
 {
	public String formatVersion = "11/1/2019 2:57:31 PM;"
	private String SALESREP;
	public String getSALESREP()
{ return this.SALESREP; }
public void setSALESREP(String value)
	{ this.SALESREP = value; }
	private BigDecimal ACCBAL;
	public BigDecimal getACCBAL() 
	{ return this.ACCBAL; } 
	private BigDecimal ACCBAL;
	public void setACCBAL(BigDecimal value)
	{ this.ACCBAL = value; }
	private BigDecimal ACTMTH;
	public BigDecimal getACTMTH() 
	{ return this.ACTMTH; }
	public void setACTMTH(BigDecimal value)
	{ this.ACTMTH = value; } 
	private String GLB_DTIME; 
	public String getGLB_DTIME()
	{ return this.GLB_DTIME; }
	public void setGLB_DTIME(String value)
	{ this.GLB_DTIME = value; }
}

The following is a sample C# Generic Message:

C# Generic Message

using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace DE.Kafka
{
     public class DEKafkaMessage
     {
          public DEKafkaMessageHeader Header { get; set;}
          public List<BatchUnit> BatchUnits { get; set; }
          public class DEKafkaMessageHeader
          {
               public long BatchId { get; set; }
               public int ThreadId { get; set; }
               public string MessageType { get; set; }
               public string MessageUniqueId { get; set; }
               public string DETransmissionType { get; set; }
               public Guid TransformationId { get; set; }
               public string ProviderId { get; set; }
               public string MessageFormatVersion { get; set; }
          }


          public class BatchUnit
          {
               public string SourceTransactionId { get; set; }
               public List<MessageUnit> MessageUnits { get; set; }
               public class MessageUnit
               {
                    public string SourceOperation { get; set; }
                    public string TargetOperation { get; set; }
                    public int OrderInBatchUnit { get; set; }
                    public string SchemaName { get; set; }
                    public string ClassifierName { get; set; }
     [XmlArray("KeysOfTarget", IsNullable = true), XmlArrayItem("KeyOfTarget", typeof(string), IsNullable = true)]
                    public List<string> KeysOfTarget { get; set; }
                    public DateTime SchemaLastModifiedDate { get; set; }
                    public string Schema { get; set; }
                    [XmlElement(ElementName = "MessagePayload")]
                    public MessagePayload Payload { get; set; }
                    public class MessagePayload
                    {
                         public string BeforeImage { get; set; }
                         public string AfterImage { get; set; }
                    }
               }
          }
     }
}