Tuesday, August 8, 2023

Startup -Shutdown -Replicate | Services

 What Is a Startup Service?

A startup service is one that the server automatically executes when it loads a package. The server loads a package:

  • At server initialization (if the package is enabled)
  • When someone uses the Integration Server Administrator to reload a package
  • When someone uses the Integration Server Administrator to enable a package

Startup services are useful for generating initialization files or assessing and preparing (e.g., setting up or cleaning up) the environment before the server loads a package. However, you can use a startup service for any purpose. For example, you might want to execute a time-consuming service at startup so that its cached result is immediately available to client applications.

What Is a Shutdown Service?

A shutdown service is one that the server automatically executes when it unloads a package from memory. If a package is in memory, the server unloads the package:

  • At server shutdown or restart
  • When someone uses the Integration Server Administrator to disable the package
  • Before the server removes the package from memory when someone uses the Integration Server Administrator to reload a package
Shutdown services are useful for executing cleanup tasks such as closing files and purging temporary data. You could also use them to capture work-in-progress or state information before a package unloads.

What Is a Replication Service?

A replication service is one that the server automatically executes when it prepares to release or archive a package. The service executes when the administrator clicks the Create Release link on the Packages > Publishing > Create and Delete Releases screen or the Archive icon archive package icon on the Packages > Management screen.

Replication services provide a way for a package to persist state or configuration information so that this is available when the package is activated on the remote server.

Guidelines for Using Startup, Shutdown, and Replication Services

Keep the following points in mind when using startup, shutdown, and replication services.

  • When you create a startup or shutdown service, you must register that service in the package with which it will be used. When you create a replication service, you can register any valid service from any loaded package on the server, including the current package itself.
  • Because services in a package are not made available to clients until that package's startup services finish executing, you should avoid implementing startup services that access busy remote servers. They will delay the availability of other services in that package.
  • You may assign one or more startup services to a package; however, you cannot specify the order in which they will execute. If you have a series of operations that must execute in a specific order, encode the entire sequence within a single service or have a startup service invoke others.



Source:

Refer: webMethods Developer guide for more info..

Monday, August 7, 2023

webMethods Package folder structure

Under packages folder, IS will be looking for all the packages that are available for execution or activation. 

Code:

This folder has subfolders as code, source and jars. Code is where the compiled class for Java services in that particular package will be stored. jars is place where you can include external jars

Config:

Any package related config files

doc:

Documentation for the package

lib:

External/internal libraries for the package

manifest.v3:

Package manifest, loaded into memory when the package is loaded.

ns:

This folder has all the code for the package. Except for the java services

pub:

Where the presentation is stored. Usually all the .dsp files are stored in this folder. .access file determines which file can be accessed from the web front end. Define file/folder and ACL in the file to provide specific accesses.

resources:

Still searching what can good use of this folder.

templates

Any output templates for the services will be stored in this folder.

web:

The wMTomcat package uses this folder. Provide the JSP application in this folder that you want to use as the web application under wMTomcat. If there is an application under this folder, the web cache for Tomcat will be in \IntegrationServer\instances\default\packages\xyz


Thanks for reading...

flow.xml Vs node.ndf Vs java.frag

Very useful stuff to know, when you want to build any tool to migrate code from webMethods to Tibco or MuleSoft.


flow.xml - is the actual xml representation of the flow service, it consists of all the variables, services, documents used in the flow service.


node.ndf - Which contains the properties of the flow service which can be seen from properties pannel.


flow.xml.bak  - It's a backup of the flow service.

node.idf → contains input , output signature of the service like field_name , field_type etc…


java.frag - It provides viewable/readable permission to your java source code.
 If you delete this file, you can't view the source code. That's why we can't view the WmPublic java services code.

Global Variables

 

Global variables can be used as config parameters when moving code from Dev to QA to Prod. And, of course use cases might be different. Basically, it's key/value model.

First, create Global Keys/Variables should be created in IS.

Note: You can save values as Password (******) also.

IS> Setting>Global variables



Next, substitute those variables in your logic



Thanks for reading...Happy Learning 


Sunday, August 6, 2023

FTP Vs File Polling

File polling:

It can be used when the files from your network or from your partners network are to be delivered to a location and if you specifiy this location in IS, then it would be like this /opt/sag/shared/in/app-xyz/working

Port Configuration at IS > security > Ports you can define a new port as an File polling and give the configuration details with polling time for monitoring the working directory and execution of a service for each polling interval(Its very important).

For each polling interval the files in the working directory were picked up kept at /opt/sag/shared/in/app-xyz/working directory for processing and after processing successfully processed files were kept at /opt/sag/shared/in/app-xyz/completed and error files were kept in /opt/sag/shared/in/app-xyz/error

FTP

It can be used often when you have an dedicated File system where the files were placed. we can do ftp by using service wmpub.cleint.ftp and define a scheduler at IS-Admin for executing ftp service at specific intervals.

Key Differences:

  •     File polling port has 4 directories each directory is used at a processing level where this cannot be found in ftp scenarios.
  •     File polling port comes with a default scheduler which we have to configure where in ftp we have to configure scheduler manually for processing documents.

Advantages:

  •     File polling port has the advantage of picking up documents from IS itself where as ftp often uses connecting to other server for picking up documents.
  •     Ftp has an advantage of doing several operations on documents with os commands like picking from location, placing to location put and get, File Polling port is capable of only picking the documents from a location.

You can choose based on your business requirement.

For more information, please check webmethods documentation @ https://documentation.softwareag.com/

Source: softwareag.com


File System (CSV /Flatfile) to DB (MySQL)

 In this example, I will explain how to process FlatFiles to DB

What is a Flat File?

Flat files present complex hierarchical structural data in a record–based storage format. Unlike XML, flat files do not embed structural data (metadata) within the data. The data in the flat file has been “flattened” by removing the hierarchical relationship between records, leaving the records intact as a single logical record of application data.

All flat files consist of a list of records containing fields and composites:

  • Fields are atomic pieces of data (for example, ID and ID qualifier, Date and time).
  • Composites contain multiple fields (for example, ID and ID qualifier, Date and time). The fields within a composite are referred to as subfields.
  • Records (also known as segments) are sequences of fields and/or composites.

Flat file Schema:

A flat file schema is a blueprint that contains the instructions for parsing or creating a flat-file. The schema exists as a namespace element in the webMethods Integration Server. This blueprint details the structure of the document, including delimiters, records, and repeated record structures. 

Sample:
EMP,EMPID,ENAME,ESAL
EMP,401,Kiran,10000
EMP,402,Jai,20000
EMP,403,Joseph,30000
EMP,404,Mohan,40000
EMP,405,Swapna,50000

Steps:
1. Create flat file schema as per your requirement. 
    Flat file definition: Specify Record parser type, Record and Fields ..etc.
    File file structure : Define record and field definitions
    Test the schema with your test data. isValid is important field
2. Use convertToValues (WmFlatFile) for converting flat files to IS document Types
3. Use Loop flow stop to process the parsed records to DB


Schema:





Flow Implementation



DB:






Source:

Saturday, August 5, 2023

File System (XML) to DB (MySQL)

 This example shows how to validate XML data with XML schema and send the data to MySQL.

1. Create XML Schema (document) by using client provided Schema, which will be used for validation later.

2. Get the file from File System by using getFile (wMPublic) service

3. Validate the XML by using validate service. Where isValid is very important..if it's true means XML data has been validated successfully means positive path. Else, XML is wrong...which goes to negative path

4. For processing Converted data to DB, call subservice. Which makes our life easy.

5. Use Try/Catch strategy everywhere.




Finally, data has been inserted successfully..





GitHub: Source Code



Thanks for reading..

webMethods - History & Products

WebMethods is an enterprise software company founded in 1996,  focused on application integration, business process integration and B2B partner integration.
In 2007 webMethods was acquired by Software AG.

Overview:

WebMethods is an integration platform that has many different runtime components &  various Development tools. It includes EAI & B2B capability. The WebMethods supports many e-standards Like XML Rosetta Net,EDI etc. WebMethods is considered a middleware market.
The main competitors of Webmethods are TIBCO, MuleSoft, IBM, Dell Boomi etc.
It also serves as a huge hub for trading partner integration.

Integration is about making things simpler – for customers, for suppliers and for employees, both IT and line of business. But the actual achievement of integration is not at all simple and requires skilled, experienced professionals who can apply integration technologies to solve and meet your organization’s unique requirements


What is WebMethods?
Software AG's webMethods Integration Platform is a proven, pre-integrated software suite featuring the market-leading Enterprise Service Bus (ESB) that enables enterprises to rapidly integrate systems, services, devices, processes, business partners and data to provide new business value and improve business performance.

What is Integration Server?

webMethods Integration Server is one of the core application servers in the webMethods platform. It is a Java-based, multiplatform enterprise integration server. It supports the integration of diverse services, such as mapping data between formats and communication between systems.

What is an Enterprise Service Bus?

Software AG’s webMethods Integration Platform is an enterprise service bus solution that quickly connects all systems and applications no matter where they reside. This powerful solution offers a proven and pre-integrated software suite that makes it easy to quickly integrate systems, servers, processes, devices, partners and data. With this enterprise service bus platform, organizations not only get a solution for application integration, B2B and cloud integration but for managed file transfer, master data management and mobile applications as well.

Enterprise Application Integration

  •     Integration Server/Broker/Adapters expertise for versions 4.x thru 7.x
  •     Consulting: Customized EAI solutions, EAI Product evaluation, Design,      Implementation, Migration, upgrade and Maintenance.
  •     Competitive migrations for ISVs - from other databases / development platforms to .Net, Windows & SQL Server.
  •     Product Evaluations: With Superior capabilities in technologies like J2EE, .NET, AS400, Mainframe, help make the right decisions with EAI tools.
  •     Adapter Development: Significant Adapter development work in integrating ERP and mainframe applications.
  •     Legacy Application and Data Integration.
  •     Legacy Application and Data Integration.
  •     Open Source and Standards-based Integration –Jboss.
  •     ESB/Messaging, JMS and standards-based technologies like XML/XSLT.

E-Standards

  •     Technical Expertise in EDI (x12, EDIFACT), XML (RosettaNet, BizTalk), HIPAA (Healthcare), SWIFT (Financial Services)
  •     EDI implementation, Migration, Upgrade, Support and Maintenance services.
  •     Design and Architect webMethods EDI implementation
  •     Integrate customized partners EDI standards.

Components of Webmethods

The architecture contains a number of components. In 8.2 webmethods 28 components are involved. But in the case of webmethods 6.1 twelve components are divided into three groups based on their utilization. The three different groups are named as:

  •     Runtime Components
  •     Design Time Components
  •     Administration Components

WebMethods Components List

  •     WebMethods Integration Server
  •     WebMethods Broker
  •     WebMethods Adapters (such as JDBC,SAP,Blaze,SFDC)
  •     CentraSite
  •     Universal Messaging
  •     WebMethods Designer
  •     WebMethods Mediator
  •     WebMethods Optimize for Infrastructure
  •     WebMethods Optimize for Process
  •     Trading Networks
  •     WebMethods Insight
  •     WebMethods Business Process Management Suite (BPMS)
  •     WebMethods Enterprise Gateway



Integration server

WebMethods Integration Server is one of the core application servers in the WebMethods platform. It is a Java-based, multiplatform enterprise integration server. It supports the integration of diverse services, such as mapping data between formats and communication between systems. An integration server may also be known as the core of WebMethods Enterprise Service Bus.

The Software AG webMethods Integration Server together with the Universal Messaging/Broker forms the foundation of the Enterprise Server Bus (ESB). The webMethods Integration Server hosts packages that contain services and related files and comes with several packages out-of-the-box.

An Integration Server instance runs as a multi-threaded process within a single Java Virtual Machine (JVM) which itself relies on operating system resources to execute its work.

Services can also be created to form the overall application systems that perform functions, such as integrating your business systems with those of external systems, retrieving data from legacy systems, and accessing and updating databases.

The Integration Server listens for client requests on one or more ports. The type of protocol that the server uses can be associated with each port. The server supports HTTP, HTTPS, FTP, FTPS and e‐mail ports.

In the WebMethods ESB , the Integration server act as the endpoint of a spoke or you can simply call IS is the spoke in the WebMethods ESB.

webMethods cloud



Source:
softwareag.com
wiki

Thanks for reading...



How to debug a Java Service.?

Please read my previous blog on Java Service Implementation to understand basics. After you have implemented Java Service successfully and e...