top of page

مجموعة علوم الحاسب و الذكاء الاصطناعي

Public·38 members
Daniel Grigoriev
Daniel Grigoriev

Learn How to Use EAI Integration Object to XML Hierarchy Converter in Siebel with Examples and Best Practices


EAI Integration Object to XML Hierarchy Converter in Siebel




XML is a widely used format for data exchange and integration among different applications and systems. However, working with XML data can be challenging and complex, especially when it comes to transforming, validating, and manipulating it. That's why Siebel Enterprise Application Integration (EAI) provides a set of tools and technologies that simplify and streamline the process of integrating Siebel applications with external applications using XML.




eai integration object to xml hierarchy converter in siebel



One of these tools is the EAI Integration Object to XML Hierarchy Converter, which is a business service that can convert between integration object property sets and XML hierarchy property sets. In this article, we will explain what this converter is, why it is useful, how to use it, and provide some examples and best practices for using it.


What is EAI Integration Object to XML Hierarchy Converter in Siebel?




EAI Integration Object to XML Hierarchy Converter is a business service that can be used if additional types of XML processing are needed, such as adding new elements, attributes, or envelopes to in-memory integration object property sets. It can also be used to manipulate XML hierarchy property sets using eScript or Siebel VB.


An integration object property set is a hierarchical representation of an integration object instance, which is based on the metadata defined in the integration object. An integration object is a logical grouping of business components that represents a business entity or message. For example, an Account integration object may consist of Account, Contact, Address, and Activity business components.


An XML hierarchy property set is a hierarchical representation of an XML document or fragment, which does not depend on any metadata but follows simple rules for converting between an XML hierarchy and an XML document. For example, every XML element becomes a property set where the tag name becomes the type, every attribute becomes a property within the element's property set, and every child element becomes a child property set.


The EAI Integration Object to XML Hierarchy Converter has two methods: IntObjHierToXMLHier and XMLHierToIntObjHier. The first method converts an integration object hierarchy to an XML hierarchy, while the second method converts an XML hierarchy to an integration object hierarchy. These methods allow you to transform data between different formats and perform various operations on them.


Why is EAI Integration Object to XML Hierarchy Converter useful for XML processing and integration?




EAI Integration Object to XML Hierarchy Converter is useful for several reasons:


It allows you to perform additional types of XML processing that are not supported by other converters, such as adding new elements, attributes, or envelopes. - It allows you to manipulate XML hierarchy property sets using eScript or Siebel VB, which gives you more flexibility and control over the data. - It allows you to convert between integration object property sets and XML hierarchy property sets without losing any information, such as namespace declarations and schema types. - It allows you to use a search specification to filter the data when converting from an XML hierarchy to an integration object hierarchy. - It allows you to use integration objects as a common data model for integrating with different applications and systems using XML.


How to use EAI Integration Object to XML Hierarchy Converter in Siebel




To use EAI Integration Object to XML Hierarchy Converter in Siebel, you need to follow these steps:


Create and configure integration objects and user properties Invoke the converter methods using business services or workflows Manipulate XML hierarchy property sets using eScript or Siebel VB


How to create and configure integration objects and user properties




To create and configure integration objects, you need to use the Integration Object Builder wizard in Siebel Tools, which allows you to generate integration objects from business objects or external definitions, such as XSD or WSDL files. You can also manually create or modify integration objects using the Object Explorer.


To configure user properties, you need to use the User Properties window in Siebel Tools, which allows you to define additional settings and behaviors for the integration objects and their components and fields. For example, you can use the XMLTag user property to specify the tag name for an integration component or field, or the XMLSchemaType user property to specify the schema type for an integration field.


Some of the user properties that are relevant for EAI Integration Object to XML Hierarchy Converter are:


User PropertyDescription


XMLHierarchySpecifies whether an integration component is converted to an XML hierarchy property set. The default value is TRUE.


XMLTagSpecifies the tag name for an integration component or field. The default value is the name of the integration component or field.


XMLSchemaTypeSpecifies the schema type for an integration field. The default value is determined by the data type of the integration field.


XMLEncodingSpecifies the encoding for an integration object. The default value is UTF-8.


XMLNamespaceSpecifies the namespace for an integration object. The default value is empty.


XMLNamespacePrefixSpecifies the namespace prefix for an integration object. The default value is empty.


XMLEnvelopeNameSpecifies the envelope name for an integration object. The default value is empty.


XMLEnvelopeNamespaceSpecifies the envelope namespace for an integration object. The default value is empty.


XMLEnvelopeNamespacePrefixSpecifies the envelope namespace prefix for an integration object. The default value is empty.


XMLEnvelopeVersionSpecifies the envelope version for an integration object. The default value is empty.


XMLEnvelopeHeaderNameSpecifies the envelope header name for an integration object. The default value is empty.


XMLEnvelopeHeaderNamespaceSpecifies the envelope header namespace for an integration object. The default value is empty.


XMLEnvelopeHeaderNamespacePrefixSpecifies the envelope header namespace prefix for an integration object. The default value is empty.


XMLEnvelopeBodyNameSpecifies the envelope body name for an integration object. The default value is empty.


XMLEnvelopeBodyNamespaceSpecifies the envelope body namespace for an integration object. The default value is empty.


XMLEnvelopeBodyNamespacePrefixSpecifies the envelope body namespace prefix for an integration object. The default value is empty.


How to invoke the converter methods using business services or workflows




To invoke the converter methods, you need to use either business services or workflows in Siebel Tools or Siebel Client, which allow you to call the EAI Integration Object to XML Hierarchy Converter business service with the appropriate input and output arguments. The input arguments are the integration object name and the integration object property set or the XML hierarchy property set, depending on the direction of the conversion. The output argument is the XML hierarchy property set or the integration object property set, respectively. For example, to convert an integration object hierarchy to an XML hierarchy using a business service, you can use the following syntax in eScript:


var bs = TheApplication().GetService("EAI Integration Object to XML Hierarchy Converter"); var inputs = TheApplication().NewPropertySet(); var outputs = TheApplication().NewPropertySet(); inputs.SetProperty("IntObjectName", "Account"); inputs.AddChild(intObjPropSet); // intObjPropSet is an integration object property set bs.InvokeMethod("IntObjHierToXMLHier", inputs, outputs); var xmlPropSet = outputs.GetChild(0); // xmlPropSet is an XML hierarchy property set


To convert an XML hierarchy to an integration object hierarchy using a workflow, you can use the following steps: - Create a workflow process with a start step, a business service step, and an end step. - In the business service step, select the EAI Integration Object to XML Hierarchy Converter business service and the XMLHierToIntObjHier method. - In the input arguments, specify the IntObjectName as a process property or a literal value, and the XMLHierarchy as an input argument or a process property. - In the output arguments, specify the IntObjectHierarchy as an output argument or a process property. - Connect the steps with transitions and activate the workflow. How to manipulate XML hierarchy property sets using eScript or Siebel VB




To manipulate XML hierarchy property sets using eScript or Siebel VB, you need to use the methods and properties of the Property Set class, which allow you to access and modify the data in a hierarchical structure. Some of the methods and properties that are relevant for XML hierarchy property sets are:


GetType: Returns the type of a property set, which corresponds to the tag name of an XML element. GetValue: Returns the value of a property set, which corresponds to the text content of an XML element. GetProperty: Returns the value of a property within a property set, which corresponds to the value of an attribute within an XML element. SetType: Sets the type of a property set, which corresponds to changing the tag name of an XML element. SetValue: Sets the value of a property set, which corresponds to changing the text content of an XML element. SetProperty: Sets the value of a property within a property set, which corresponds to changing the value of an attribute within an XML element. AddChild: Adds a child property set to a parent property set, which corresponds to adding a child element to a parent element in an XML hierarchy. RemoveChild: Removes a child property set from a parent property set, which corresponds to removing a child element from a parent element in an XML hierarchy. GetChild: Returns a child property set from a parent property set by index or type, which corresponds to getting a child element from a parent element in an XML hierarchy by position or tag name. Copy: Copies a property set and its children, which corresponds to cloning an XML element and its descendants.


For example, to add a new element with an attribute and some text content to an XML hierarchy property set using eScript, you can use the following syntax:



var ps = TheApplication().NewPropertySet(); // ps is an XML hierarchy property set var child = TheApplication().NewPropertySet(); // child is a new child property set child.SetType("NewElement"); // sets the tag name of the new element child.SetProperty("NewAttribute", "NewValue"); // sets the attribute and value of the new element child.SetValue("NewText"); // sets the text content of the new element ps.AddChild(child); // adds the new element as a child of ps


The resulting XML hierarchy would look like this:



<ps> <NewElement NewAttribute="NewValue">NewText</NewElement> </ps> Examples of EAI Integration Object to XML Hierarchy Converter in Siebel




To illustrate how EAI Integration Object to XML Hierarchy Converter works in Siebel, we will provide two examples of using this converter for different scenarios. In each example, we will show the input and output property sets, the user properties, and the code snippets for invoking the converter methods.


Example 1: Converting an integration object hierarchy to an XML hierarchy with namespace declarations and schema types




In this example, we have an integration object named Account that represents an account entity with some basic information, such as name, type, status, and contacts. We want to convert this integration object hierarchy to an XML hierarchy with namespace declarations and schema types, so that it can be validated against an XSD schema and used for integration with other applications.


The input integration object property set looks like this:



<IntObject> <Account> <Name>Acme Inc.</Name> <Type>Customer</Type> <Status>Active</Status> <ListOfContact> <Contact> <FirstName>John</FirstName> <LastName>Doe</LastName> <Email>john.doe@acme.com</Email> </Contact> <Contact> <FirstName>Jane</FirstName> <LastName>Doe</LastName> <Email>jane.doe@acme.com</Email> </Contact> </ListOfContact> </Account> </IntObject>


The user properties for the integration object and its components and fields are as follows:


Object TypeNameUser PropertyValue


Integration ObjectAccountXMLEncodingUTF-8


Integration ObjectAccountXMLNamespacehttp://www.example.com/account


Integration ObjectAccountXMLNamespacePrefixacc


Integration ComponentNameXMLSchemaTypexsd:string


Integration ComponentTypeXMLSchemaTypexsd:string


Integration ComponentStatusXMLSchemaTypexsd:string


Integration Component FieldEmailXMLSchemaTypexsd:string


Integration Component FieldEmailXMLTagEmailAddress


Integration Component Field


>XMLSchemaType>xsd:string


>Integration Component Field>LastName>XMLSchemaType>xsd:string


>Integration Component Field>LastName>XMLTag>Surname


To convert this integration object hierarchy to an XML hierarchy, we can use the following eScript code:



var bs = TheApplication().GetService("EAI Integration Object to XML Hierarchy Converter"); var inputs = TheApplication().NewPropertySet(); var outputs = TheApplication().NewPropertySet(); inputs.SetProperty("IntObjectName", "Account"); inputs.AddChild(intObjPropSet); // intObjPropSet is the input integration object property set bs.InvokeMethod("IntObjHierToXMLHier", inputs, outputs); var xmlPropSet = outputs.GetChild(0); // xmlPropSet is the output XML hierarchy property set


The output XML hierarchy property set looks like this:



<acc:Account xmlns:acc="http://www.example.com/account"> <acc:Name xsi:type="xsd:string">Acme Inc.</acc:Name > <acc:Type xsi:type="xsd:string">Customer</acc:Type> <acc:Status xsi:type="xsd:string">Active</acc:Status> <acc:ListOfContact> <acc:Contact> <acc:FirstName xsi:type="xsd:string">John</acc:FirstName> <acc:Surname xsi:type="xsd:string">Doe</acc:Surname> <acc:EmailAddress xsi:type="xsd:string">john.doe@acme.com</acc:EmailAddress> </acc:Contact> <acc:Contact> <acc:FirstName xsi:type="xsd:string">Jane</acc:FirstName> <acc:Surname xsi:type="xsd:string">Doe</acc:Surname> <acc:EmailAddress xsi:type="xsd:string">jane.doe@acme.com</acc:EmailAddress> </acc:Contact> </acc:ListOfContact> </acc:Account>


This XML hierarchy can be easily validated against an XSD schema and used for integration with other applications that expect this format.


Example 2: Converting an XML hierarchy to an integration object hierarchy with a search specification




In this example, we have an XML document that contains a list of accounts with some basic information, such as name, type, status, and contacts. We want to convert this XML document to an integration object hierarchy with a search specification, so that we can query and update the data in Siebel using EAI.


The input XML document looks like this:



<Accounts> <Account> <Name>Acme Inc.</Name> <Type>Customer</Type> <Status>Active</Status> <Contacts> <Contact> <FirstName>John</FirstName> <LastName>Doe</LastName> <Email>john.doe@acme.com</Email> </Contact> <Contact> <FirstName>Jane</FirstName> <LastName>Doe</LastName> <Email>jane.doe@acme.com</Email> </Contact> </Contacts> </Account> <Account> <Name>Beta Corp.</Name> <Type>Partner</Type> <Status>Inactive</Status> <Contacts/> </Account > <Account> <Name>Gamma Ltd.</Name> <Type>Prospect</Type> <Status>New</Status> <Contacts> <Contact> <FirstName>Bob</FirstName> <LastName>Smith</LastName> <Email>bob.smith@gamma.com</Email> </Contact> </Contacts> </Account> </Accounts>


The output integration object property set should look like this:



<IntObject> <Account SearchSpec="[Name] = 'Acme Inc.'"> <Name>Acme Inc.</Name> <Type>Customer</Type> <Status>Active</Status> <ListOfContact SearchSpec="[FirstName] = 'John' AND [LastName] = 'Doe'"> <Contact> <FirstName>John</FirstName> <LastName>Doe</LastName> <Email>john.doe@acme.com</Email> </Contact> </ListOfContact > </ListOfContact> </Account> </IntObject>


This integration object property set can be used to query and update the data in Siebel using EAI.


To convert this XML document to an integration object hierarchy with a search specification, we can use the following eScript code:



var bs = TheApplication().GetService("EAI Integration Object to XML Hierarchy Converter"); var inputs = TheApplication().NewPropertySet(); var outputs = TheApplication().NewPropertySet(); inputs.SetProperty("IntObjectName", "Account"); inputs.SetProperty("SearchSpec", "[Name] = 'Acme Inc.' AND [ListOfContact.FirstName] = 'John' AND [ListOfContact.LastName] = 'Doe'"); var xmlPropSet = TheApplication().NewPropertySet(); // xmlPropSet is the input XML hierarchy property set xmlPropSet.SetValue(xmlDoc); // xmlDoc is the input XML document inputs.AddChild(xmlPropSet); bs.InvokeMethod("XMLHierToIntObjHier", inputs, outputs); var intObjPropSet = outputs.GetChild(0); // intObjPropSet is the output integration object property set


Best practices and tips for using EAI Integration Object to XML Hierarchy Converter in Siebel




To use EAI Integration Object to XML Hierarch


About

Welcome to the group! You can connect with other members, ge...

Members

bottom of page