Categories
Blog

Power of Predictive Analytics

What is Predictive Analytic?

Using data, statistical algorithms, and machine learning approaches, predictive analytics forecasts the likelihood of future outcomes based on historical data. The objective is to provide the most accurate prediction of what will happen in the future in addition to understanding what has already occurred.

Predictive analytics’ history dates to 1689. Many people contributed to the development of this field to the last 50 years’ worth of technological advancements. It’s right to say that modern technologies like relational databases, faster CPUs, and even Hadoop and MapReduce have made predictive analytics a usable tool for decision-making. Predictive analytics, however, have been used for centuries, according to history. One of the first applications of predictive analytics was in underwriting back when shipping and trade was primarily conducted traveling the seas.

Science & techniques behind predictive data analytics

Predictive models develop (or train) a model that may be applied to forecast values for various or new data sets using known outcomes. Based on estimated appropriateness from a set of input variables, modeling produces outcomes in the form of predictions that reflect a probability of the target variable (for example, revenue).

This differs from descriptive models that assist you identify important relationships and figure out why something happened or descriptive theories that describe what happened. Analytical approaches and processes have entire books devoted to them. Here are some fundamentals to get you know.

There are two types of predictive models. Classification models predict class membership. For instance, you try to classify whether someone is likely to leave, whether he will respond to a solicitation, whether he’s a good or bad credit risk, etc. Usually, the model results are in the form of 0 or 1, with 1 being the event you are targeting. Regression models predict a number – for example, how much revenue a customer will generate over the next year or the number of months before a component will fail on a machine.

The three most popular methods for predictive modeling are neural networks, regression, and decision trees.

  • Decision trees

Decision trees are categorization models that divide data into subgroups according to groups of input factors. This helps you understand a person’s action plan. A decision tree resembles a tree with each leaf serving as a typology or decision and each branch serving as an option among several alternatives.

  • Regression

One of the most widely used statistical techniques is regression (both linear and logistic). Regression analysis determines how different variables are related. It identifies important patterns in huge data sets and is frequently used to evaluate the degree to which factors, such as price, influence the movement of an asset. It is designed for continuous data that may be assumed to follow a normal distribution.

  • Neural networks

Advanced modeling tools like neural networks may simulate incredibly complicated relationships. They are well-liked since they are strong and adaptable. They are powerful because they can handle nonlinear relationships in data, which are becoming more prevalent as we gather more data. They are frequently used to validate the results of straightforward methods like decision trees and regression. Pattern recognition and some AI techniques that visually “model” parameters are the foundation of neural networks.

Other Popular Techniques

  1. Bayesian analysis
  2. Ensemble models
  3. Gradient boosting
  4. Incremental response
  5. K-nearest neighbor (KNN)
  6. Memory-based reasoning
  7. Partial least squares
  8. Principal component analysis
  9. Support vector machine
  10. Time series data mining

Benefits Of Predictive Analytics

  • Making Better Decisions

Decision-making can be done at a higher level because of predictive analytics. You can make more wise decisions the more data the system has at its available. Large amounts of data can be analyzed to find patterns and trends, giving organizations information they might not have had before.

  • Increasing Operation Efficiency

The use of predictive analytics enhances resource management, inventory forecasting, organizational efficiency, performance optimization, and income generation. It enables them to proactively enhance their production processes and respond appropriately when necessary.

  • Finding Fraud

Patterns can be found using predictive analytics to spot and stop illegal activity. Predictive analytics aids in the identification of anomalies that could point to cyberthreats and vulnerabilities as cybersecurity becomes more prominent. This assists businesses in putting appropriate policies in place, protecting their information and operations from fraud and other online threats.

  • Reduce risk

In the financial and insurance industries, predictive analytics is utilized to create accurate and trustworthy client profiles that aid in efficient decision-making. For instance, credit ratings determine a person’s creditworthiness, which lowers the risk to the company.

  • Marketing Campaign Effectiveness

Marketing strategies heavily rely on understanding consumer behavior and buying patterns, and predictive analytics makes it easier to analyze data and find fresh ways to draw in or keep customers.

Where Can Predictive Analytics Be Applied?

  • Manufacturing
  • Health & Insurance
  • Oil, Gas & Utilities
  • Governments & the Public Sector
  • Banking & Financial Services
  • Retail sector
  • Educational sector

Predictive Analytics Software Packages

By extracting data from data sets to identify patterns and trends, predictive analytics software mines and analyzes historical data patterns to forecast future results. Business managers can use decision models created by analysts using predictive analytics solutions to plan for the optimal outcome using a wide range of statistical analyses and algorithms. Predictive analytics software is used by analysts, business users, data scientists, and developers to better understand consumers, partners, and products as well as to spot possible dangers and commercial possibilities. Predictive analytics programs enable organizations to use big data (both stored and real-time) to move from a historical view to a forward-looking perspective of the customer. These tools can be deployed both on premise (usually for enterprise users) and in the cloud.

Popular Predictive Analytics Software Packages in 2022

  • Qlik Sense

Ability to make better data-driven decisions and act using Qlik Sense. From visualization and dashboards to natural language analytics, customizable and embedded analytics, reporting, and alerting, the system offers enhanced analytics for every business need. Its innovative associative technology offers unique capabilities for merging data and exploring information, boosting human intuition with AI-powered insights.

  • Alteryx

Alteryx is a creative, end-to-end, low-code / no-code data analytics platform that enables anybody, anywhere, to transform huge amounts of information into rapid insights that support daily breakthroughs. Today, businesses all around the globe on Alteryx to quickly upskill their staff and achieve results that have a significant impact on the bottom line.

  • SAP Analytics Cloud

With the SAP Analytics Cloud solution, you can easily access various sources of data while combining analytics and planning with integration with SAP applications. You can make decisions with confidence due to SAP Analytics Cloud’s support for integrated planning processes throughout the whole company and its role as the analytics and planning solution within the SAP Business Technology Platform.

  • IBM SPSS Modeler

One of the leading visual data science and machine learning solution is the IBM SPSS Modeler. By expediting the core functions for data scientists, it supports businesses in accelerating time to value and desired results. Leading businesses around the world rely on IBM for machine learning, predictive analytics, model management, and data discovery to leverage their data assets. With full, pre-built algorithms and models that are suitable for hybrid, multi-cloud systems with strong governance and security postures, the IBM SPSS Modeler gives enterprises the ability to tap into data assets and current apps.

  • Minitab Statistical Software

To assist data-driven decision making, Minitab Statistical Software provides visualizations, statistical analysis, prediction, and improvement analytics. When an organization’s employees have access to simple analysis tools, they are all given more authority, regardless of their statistical knowledge or geographical location. By providing a complete and best-in-class package of data analysis and process optimization tools, Minitab has helped businesses and institutions identify patterns, address issues, and uncover insightful data for almost 50 years.

Any more information or demo we are willing to help Contact us

– Heaven Gunarathna

Categories
Blog

Selecting a BI Solution for your Business

Companies may build products, analyze their advertising efforts, customize content, and create content strategies with the aid of data analysis. Data analytics can ultimately help firms increase performance and boost their bottom line.

Main factors to be aware of when selecting a BI solution for your business.

  • Ability to meet specific business needs
  • Ease of use
  • Cost for BI Solution
  • Technology to be used
  • Time Estimation
  • Limitations of BI solution
  • Product Scalability
  • Product Security
  • After service
  • Globalization growth

What kind of data do you want to analyze:

Before choosing the right BI tool, you need to know what kind of data you want to analyze. That is because different BI dashboards are designed for diverse types of data analysis. For example, suppose you want to analyze transactional data (e.g., sales transactions). In that case, a business intelligence tool designed for analyzing transactional data will be more useful than one designed for analyzing social media or other unstructured data sources. You should also think about if your company requires numerous platforms to manage different sorts of data or just one platform to handle all data. For instance, your company might need two different platforms if it must analyze and visualize both transactional and social media data. However, if it only needs to evaluate transactional data, a single platform should be adequate (e.g., sales transactions). The screening process will go much more smoothly if you define your BI tool’s purpose clearly.

Ability to meet specific business needs:

There are eight areas to be evaluated.

  1. Access data and create new dashboards: Access the data you need to build interactive dashboards without technical assistance. Technology helps users to develop dashboards in a low code manner.
  2. Customize existing dashboards: Easy to use tools to manipulate and visualize data exactly how you want.
  3. Drill into reports: Zoom into details and underlying data for enhanced analysis. Can add color rules. When needed, the report can warn the reader from colors.
  4. Interact from mobile: Share and analyze with dashboards directly from any mobile device. Today it supports various mobile operating systems. (Android OS.,   Apple iOS., Blackberry OS.)
  5. Data visualization: Capability to automatically transform data into Line charts, Area charts, Bar and column charts, Doughnut charts, Funnel charts, Gauge charts or other types of visual presentation.
  6. User-friendly interfaces: All the features of the BI must be easy to access. Also, mobile environments should offer responsive touch interfaces in a native app.
  7. Analytical capabilities of the BI solution:  It maximizes the opportunities for your organization.
  8. Checks Business Validations: This will ensure that business validations are followed correctly. Otherwise, the system can send alerts.

Ease of use:

  1. Accessibility, flexibility, and availability:  A BI solution should be easy for users across the organization to access whether they are in the office, working remotely, or on the road.
  2. Easiness to train team members/employees to use the solution
  3. Self-service capabilities: A good BI solution must be designed for businesspeople to use on their own as a self-service solution.
  4. Easy navigation across the solution: BI solution should be easy to navigate with point-and-click or drag-and-drop features. It should give users a choice of doing a task themselves or employing automation to handle it.

Cost for BI Solution:

  1. Accessibility, flexibility, and availability:  A BI solution should be easy for users across the organization to access whether they are in the office, working remotely, or on the road.
  2. Easiness to train team members/employees to use the solution
  3. Self-service capabilities: A good BI solution must be designed for businesspeople to use on their own as a self-service solution.
  4. Easy navigation across the solution: BI solution should be easy to navigate with point-and-click or drag-and-drop features. It should give users a choice of doing a task themselves or employing automation to handle it.

Cost for BI Solution:

Most BI tools have an initial cost, but there are also recurring expenses related to using them. These consist of maintenance expenses, consultation and training expenditures, and license renewal fees. Take a note that costs vary from one vendor to another, but here are some things you can expect to pay for:

  1. Pricing models: Some vendors charge per seat or per user, while others charge by the number of data sources in the system. The latter model is often more expensive because it requires more customization.
  2. Licensing fees: These fees may be based on the number of users or seats. Some vendors offer multiple license levels — such as basic, standard, or enterprise — and charge accordingly.
  3. Data management fees: If your organization needs help setting up datasets and loading them into the system, expect to pay extra for this service.

Any more information or demo we are willing to help Contact us

– Heaven Gunarathna

Categories
Blog

ERP transformation with Cloud

Business world is continuously improving in order to make the things easier quicker and cost effective. The cloud technology is also such technological invention which pitched in the IT industry to serve business needs. Businesses are increasingly using cloud solutions to integrate their various systems. ERP (Enterprise Resource Planning) is becoming a more popular cloud solution for small and medium sized businesses (SMBs).

Cloud-based ERP is an enterprise resource planning software that can be accessed via the Internet. All cloud-based ERP software supports basic business functions. It efficiently automates essential business workflow across multiple industries. Basic functions like finance and accounting, human resource management, marketing, customer relationship management and supply chain management functions are some common functions facilitated through ERP. In general, cloud ERP solutions offer a more efficient approach by allowing businesses to take advantage of vast computing power. Shifting to cloud ERP generally offers lower upfront costs, faster implementation and reduced physical and staff resource usage. There are many benefits and reasons why companies are switching from on-premises to cloud ERP. Some of them are,

Lower costs

The initial cost of implementing cloud ERP software is significantly lower than on-premises systems, which can reduce existing costs and thus avoid the need for large-scale capital.

It not only saves capital costs, but also reduces operating costs by eliminating the need for hardware configuration and software upgrades, system management, and performance management compared to on-premises ERP.

Security

Customer or the ERP user can experience higher security with the cloud technology. The security of cloud-based software is often better than the security of on-premises ERP systems. In addition, ERP cloud servers are located in secure and centralized facilities, reducing the risk of physical theft. Cloud ERPs providers focus a lot of their efforts on avoiding downtime and having robust power backups and fail-safes in place.

Implementation

Cloud solutions can be configured and deployed much faster than on-premises systems. These systems are specifically aimed at creating highly responsive, adaptable, and easy-to-implement solutions.

Improved accessibility, collaboration, and agility

Cloud ERP offers improved accessibility, usability, and mobility Compared to on-premise ERPs. Using cloud-based ERP allows for more corporate agility which means employees can easily access the tools they need from anywhere, anytime via the internet. It also gives access to real-time information and provides insights into the status of all processes and data.

Reduce dependency and free up internal IT teams

Moving to a cloud-based ERP can have a major impact on company’s internal IT team. This is especially useful for small businesses to get the most out of their IT team also companies who do not have an IT sector can run smoothly without making these additional investments.

Scalability

Companies are having varying requirements for handling data. It could be seasonal or periodical. Adding new hardware and networking is a main part of expansion when it comes to on-premises ERP expansion. This is time consuming and costly. But cloud ERP systems are much more flexible hence easy to adopt with the demand and available to increase and decrease the capacity on incremental cost basis.

Access to emerging technology

Technology is rapidly evolving today. With the advancement of technology, the competitiveness of companies has also increased. Advanced analytics, artificial intelligence, machine learning, and other technological advancements enable the use of massive volumes of data. They can improve forecasting accuracy, discover hidden insights, improve productivity, and offer innovative products. Cloud ERP allows taking advantage of this prominent technology more efficiently and cost-effectively. The service already includes Artificial intelligence, machine learning, analytics, and other business intelligence technologies. This means that businesses can benefit without the physical infrastructure, expenditures, or technical talent that on-premises systems require.

Real-time data

Cloud based ERP provides real-time data better than traditional systems. The possibilities of inaccurate data are reduced when bottlenecks at various software integration points are removed. Hence, the information given is always up to date because the applications and information are hosted in a central cloud location.

Easier customization

Configuring on-premises ERP systems to match the company objectives is more expensive and needs more time and IT resources than cloud-based ERP. This involves integrating the relevant ERP features with third-party applications and performing any necessary software and hardware upgrades.



– Nisandi Nethmani

Categories
Blog

From ESG to EESG

Term ESG is not a novel idea or a concept in modern business parlance and same is true for derivative concepts such as ESG Reporting and ESG Investing. ESG guides us to be environmentally sustainable, socially responsible, and standby principles of good governance when we transact business. All responsible corporate citizens have shown their willingness to adhere to principles of ESG with varying degree of commitment. Since inception we as CONIFS never lost sight of ESG and our actions speak for that. More recently we have been asking the question ‘are we doing enough?’ from ourselves. That is how we have been drawn to ‘Equity’ and then from ESG to EESG.

Our construct of ‘Equity’ in the context of ESG centers around the question whether we are doing enough compared to our capabilities?’ Yes, we have tried to be environmentally sustainable by allowing our employees to work from home and thereby reduce carbon emissions and improve psychological wellbeing of employees by cutting down the stress of commuting. But can we do more to towards environmental sustainability and be socially responsible. Driven by this we have given more opportunities for female candidates and at the moment women account for 50% of workforce. We constantly promote female employees to leadership positions and committed to opening new avenues to create flexible environments for working parents.

As responsible employer we pegged our employee salaries Euro to absorb the effect of inflation in Sri Lanka and we did it with transparent and equitable manner. In our effort to be socially responsible, we focused our efforts on youth empowerment. This year we have increased number of internship opportunities for university undergraduates and working hard to increase the quality of internship with focused training, opportunities for explore new things and better compensation. In an economic situation where most are vying to reduce expenditure, we have decided to increase our CSR budget with the aim of consoling fellow citizens who are in distress.

At CONIFS, ESG is not cliché or just another tag line but contrary it is a governing principle and all at CONIFS are committed to it. From ESG we in journey towards EESG with increased focus on whether our efforts and commitment towards ESG is proportionate to our capabilities.

Categories
Blog

Uniformity in Integration

In the area of internet of things (IoT) system integration and integration platforms will reign high and dominate most IT discourse.

It is commonplace that in most enterprise IT infrastructures there is a central enterprise resource planning (ERP) system and multiple supplementary or complimentary applications that augment the capabilities of ERP at the center to serve the needs of business. Today there is an emerging trend that large scale organizations adopt two tier ERP setup where there is high power ERP at center work in tandem with an ERP of lesser caliber placed at identified organization location together with a series of peripheral devices. The complexity of the integration landscape gets compounded by the need to deal with customer or supplier ERPs, different ERPs in subsidiaries or sister companies within the same organization and with multiplicity of devices. All these dimensions of integration entail a robust yet simple integration mechanism that ensure all the applications and devices work seamlessly. But most organizations do not enjoy the luxury of robust yet simple integration mechanism.

One of our customers headquartered in Scandinavia with a global presence used at least three different integration platforms to establish a connection between peripheral applications such as payrolls, expense registration systems, invoice scanning systems, tools handling applications and the central ERP, the IFS Applications at the center.  One such integration platform was a ‘gateway’ tool with extremely limited market penetration, another was the inbuilt ‘connect’ capabilities of their ERP and third was the old fashion ODBC method. None of these were capable of handling complexities of customer’s IT landscape and reach the level of sophistication they desired.

Then they were introduced to the WSO2, a world-renowned integration and identity access management platform (www.wso2.com ). With WSO2 our customer has been able to replace multiple modes of integration with a single mode of integration and thereby achieve the uniformity in integration they desired. Apart from technological superiority and security offered by WSO2, moving to WSO2 brought forward operational advantages to the organization.

As we noticed such operational advantages are,

Reduce Rework and Increase Reuse

Our customer is a global service provider to energy sector with special focus on the offshore market. On daily basis they deal with enormous number of employees and use high number of IT applications such as planning tools, time registration tools, expense management tools, payroll to cater to country specific needs. All these applications need one common set of data, the employee information. Previously there were multiple and ad hoc ways to deal with each peripheral application but with WSO2 there is one employee information output from their ERP that can cater to unique needs of peripheral applications. When the next new application comes no need begin from nothing, but instead existing interfaces can cater to it. So, rework is reduced, and use of existing features is increased.

Access to Resources

One of the integration platforms previously used, the ‘gateway’ tool was a creation of one of their IT suppliers. The knowledge about the tool was with handful of employees at the supplier. Since its low market penetration, no third parties to which the customer could resort to for support or consultancy.

Therefore, the access to quality resources when the customer needs them was extremely limited. But WSO2 comes with state-of-the-art customer support of their own and network of partners who are equally capable of supporting users of WSO2.

Reduce Dependency

With lesser-known products comes the hazel of lesser access to capable resources, lesser competitive pricing and higher dependency on vendor. But with a mature product with significant market penetration, you get the benefit of competent resources at competitive prices and thereby reduce or even diminish dependency on vendors with limited global presence.

Uncompromised Uptime

No product is fool proof, and any product can get glitches here and there. WSO2 ensures uncompromised uptime with superiority of its product backed by professional user support provided by WSO2 itself and a series of capable partners such as CONIFS. This availability of support and thereby constant push to reduce downtime is not a luxury that most integration platforms can boast of.

Integration itself is not a destination but instead it is more of a journey with constant product updates WSO2 together with its partner like CONIFS is committed to enable the next level of IT enablement for enterprises.

Categories
Blog

Importance of Business Intelligence

Business Intelligence (BI) is a technological process of transforming data into action information for the benefit of stakeholders. This information helps executives, managers and workers make informed business decisions. Set of data which have been collected over a period or wide array is used as the base in BI solutions. BI solutions predominantly focused on business insights for the proactive decision making and used for planning and risk management purposes. However, BI solutions could be used to provide historical, current and predictive views of business operations. Business reporting, online analytical processing, data and process mining, text mining, complex event processing, benchmarking, business performance management are some common functions of business intelligence.

Business intelligence helps businesses to analyze customer behavior and competitor behavior, predict market or industry behavior, set benchmarks and track performance. Overall business performance and competition related decisions are fueled by the Business Intelligence functions. Insightful analysis discovers potential issues or problems for business’s contingency planning.

Different industries are aligned business intelligence tools to manage and coordinate its day-today operations.

Logistics Industry

Logistics is one of the most complicated industries which requires constant overlooking and immediate action based on delivery stage in the supply chain. Large data sets are processed and display through customized dashboards to track the orders effectively. Graphical representation methods being used to make the dashboards user friendly and informative.

Banking and Finance 

Financial and banking companies deal with large amount of data and requirement is to analyse data and identify marketing opportunities by combining advanced technologies such as Microsoft SQL, machine learning.  AI with cloud-based Power BI helps financial and banking companies collect, store, and analyze real-time data.

Construction Industry

Construction industry is complicated industry with multiple needs. It required fine deal with work schedules and deadlines, suppliers, and production processes. Collaboration and coordination for running everything smoothly and getting all the processes done is an integral part when it comes to construction industry. Business intelligence helps to project wise overlooking of all touchpoints in one place through all-inclusive dashboards.

Retail Industry

Stock following is one of the retailer’s prominent BI benefits from the time an order is delivered to the point of sale. BI use data warehousing to empower retailers to track the supply handing. In addition to tracking the orders, BI helps to determine the quantity based on the sales forecast and alerting to re-order on time. Human decision making on continuous supply is replaced with I suggestions on the process.

Manufacturing Industry

Industry-specific knowledge is vital for manufacturing businesses. Business Intelligence helps to analyze manufacturing process to identify the business process bottlenecks and establish effective and efficient process. BI serves as the primary source of structured and reliable solutions for bringing together all related processes to eliminate errors. Manufacturing processes can be easily optimized and improved through a manufacturing dashboard that integrates key data through real-time analysis, features vast interactivity and other features, and predicts what will happen in the future.

At CONIFS our mission is to transform treasure trove of transactional data sitting in your ERP into value generating information insights for decision makers. In our view implementing a BI solution in an organization is more of a business venture than a technical venture handled by few individuals in an isolated corner within IT department. We can help you to make a dream of holistic, robust, and user-friendly BI solution a reality.

Contact us

Categories
Blog

4Ps of ERP Support

ERPs in the world are yet achieve the level sophistication that either they are so simple or intuitive that any user can use it without any user support. Contrary to utopian dream of plug and play ERPs users of modern ERPs need not periodic but continuous user support keep them afloat in sea of functionality and labyrinth of processes.

We believe that success of any ERP support depends on four main pillars. They are policies, processes, platforms and undeniably the people.

Policies

The organizational level policy on user support plays a pivotal role in shaping the ERP user support landscape of an organization. The policy framework influences the availability of support, expected service levels at each level of support and comparative weightage allocated user support aspect among the total IT activities. 

Processes

Processes define framework within which the user support is executed. The modes available to report and issue, the initial response, degree of processing at the first level support in cases of a multi layered support organization, assigning priority, escalation handling, user feedbacks and anything and everything in support execution is process driven.

Platforms

Support platform is the medium through which users interact with support experts, it is central ledger for all support issues and the tool to trace and track all support issues. Selection of platform is critical as it defines ways and means available for user to report an issue, modes available for content sharing, history tracking and most importantly provide leadership with vital data on process improvements and training need in the organization with intelligent processing of support issues over a period.

People

People on the either side of the aisle, namely the providers of support and receivers of support takes the center stage in any ERP support operation. The experience and expertise of the support professionals on ERP they support, level of understanding on the real business, communication together with empath of them will define the destiny of any support operation.

Categories
Blog

WSO2 EI – Scatter and Gather

Scatter and Gather is one of the common Enterprise Integration Patterns (EIP). As one of the leading open-source integration platforms, the WSO2 Enterprise Integrator (EI) provides an out-of-the-box approach to achieve it using synapse mediators.

In this article, we will be checking two approaches to achieve the Scatter and Gather pattern using Iterate and Clone mediators respectively.

1.Using Iterate-Aggregate mediators

Iterate mediator splits the parent message into smaller messages and sends each child message to the backend service. Then the aggregate mediator can be used to combine responses from each backend call to a single message before responding to the client.

Here is a sample API service that uses the Iterate and Aggregate mediator combination.

<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ws.apache.org/ns/synapse" name="IterateAPI" context="/employees">
   <resource methods="POST">
      <inSequence>
         <iterate id="employee_iterator" preservePayload="true" attachPath="json-eval($.employees)" expression="json-eval($.employees)">
            <target>
               <sequence>
                  <send>
                     <endpoint>
                        <http method="POST" uri-template="http://run.mocky.io/v3/a9d63220-8fa8-4021-add0-28a635e965b2" />
                     </endpoint>
                  </send>
               </sequence>
            </target>
         </iterate>
      </inSequence>
      <outSequence>
         <property name="info" scope="default">
            <Aggregated_Response />
         </property>
         <aggregate id="employee_iterator">
            <completeCondition>
               <messageCount min="-1" max="-1" />
            </completeCondition>
            <onComplete expression="json-eval($)" enclosingElementProperty="info">
               <respond />
            </onComplete>
         </aggregate>
      </outSequence>
      <faultSequence />
   </resource>
</api>

The API service is designed to accept a JSON message and split the message into employee JSON objects, before sending it to the desired backend service.

Use the below payload to invoke the above API service.

{
    "employees":[
        {"emp_id":15693, "name":"Adrian"},
        {"emp_id":16180, "name":"Andrea"},
        {"emp_id":15025, "name":"Barry"}
   ]
}

You will get a response as below.

{
    "Aggregated_Response": [
        {"Response": "Success" },
        { "Response": "Success" },
        {"Response": "Success" }
    ]
}

2. Using Clone-Aggregate mediators

Similar to the Iterate mediator, the clone mediator also can be used to send messages to multiple backends. The difference is that when the Iterate mediator splits the original message into child messages the clone mediator clones the original message and sends identical copies to the backend.

Try the below API service to understand the clone mediator functionality.

<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ws.apache.org/ns/synapse" name="CloneAPI" context="/employees">
   <resource methods="POST">
      <inSequence>
         <clone>
            <target>
               <endpoint name="endpoint_1">
                  <http method="POST" uri-template="http://run.mocky.io/v3/6e367e76-e197-4ab3-a4c9-ea659b8ffbe9" />
               </endpoint>
            </target>
            <target>
               <endpoint name="endpoint_2">
                  <http method="POST" uri-template="http://run.mocky.io/v3/332f7d23-e4d3-427c-91bf-b8fd2d35c6df" />
               </endpoint>
            </target>
            <target>
               <endpoint name="endpoint_3">
                  <http method="POST" uri-template="http://run.mocky.io/v3/537616ea-355c-47f1-ad3c-64fa3378661f" />
               </endpoint>
            </target>
         </clone>
      </inSequence>
      <outSequence>
         <property name="info" scope="default">
            <Aggregated_Response />
         </property>
         <aggregate>
            <completeCondition>
               <messageCount min="-1" max="-1" />
            </completeCondition>
            <onComplete expression="json-eval($)" enclosingElementProperty="info">
               <respond />
            </onComplete>
         </aggregate>
      </outSequence>
      <faultSequence />
   </resource>
</api>

Use the below payload to invoke the above API service.

{
    "employees":[
        {"emp_id":15693, "name":"Adrian"},
        {"emp_id":16180, "name":"Andrea"},
        {"emp_id":15025, "name":"Barry"}
   ]
}

You will get the below response.

{
    "Aggregated_Response": [
        {"Response": "From Backend 1"},
        {"Response": "From Backend 2"},
        {"Response": "From Backend 3"}
    ]
}

The Iterate mediator sends every request to the same backend service. But when using the Clone mediator, we can invoke different backend services parallelly and aggregate the response from each.

That’s it then.

Each approach has its pros and cons. Give both a try and see what suits you the most. 

We suppose that you learned something out of this. Keep in touch with us as we will be sharing more content in our future blog posts.

Thanks for reading.

Dilhara Hewamaddumage
Categories
Blog

WSO2 EI – Reading Query and Path Params

It is common to use query and path parameters when invoking integration services. Here we will be learning how we can read query and path parameters of the incoming request and access them inside the integration logic.

  1. Reading query params

There are two ways of doing this:

  • Using synapse xpath variable $url

Using the synapse xpath variable is the easiest and the best way to access query parameters. It is faster than using the get-property function.

Let’s assume we are invoking an API service with two query params called ‘first_name’ and ‘last_name’. The following API service will read those query params and return them as the response payload.

<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ws.apache.org/ns/synapse" name="ParamAPI" context="/params">
   <resource methods="GET">
      <inSequence>
         <!-- set parameter values to response payload -->
         <payloadFactory media-type="json">
            <format>{"Hello":"$1 $2"}</format>
            <args>
               <arg evaluator="xml" expression="$url:first_name" />
               <arg evaluator="xml" expression="$url:last_name" />
            </args>
         </payloadFactory>
         <respond />
      </inSequence>
   </resource>
</api>

You can invoke the above APi using the URL:

https://localhost:8243/params?first_name=John&last_name=Doe

The above API service shows how to read query param values using $url:first_name, $url:last_name and set them in the response payload.

Similarly, you can read param values to properties as below.

<property name="first_name" expression="$url:first_name" scope="default" type="STRING" />
<property name="last_name" expression="$url:last_name" scope="default" type="STRING" />
  • Using the get-property(‘query.param.<param_name>’)

Here is a sample API service that uses the get-property() function.

<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ws.apache.org/ns/synapse" name="ParamAPI" context="/params">
   <resource methods="GET">
      <inSequence>
         <payloadFactory media-type="json">
            <format>{"HI":"$1 $2"}</format>
            <args>
               <arg evaluator="xml" expression="get-property('query.param.first_name')" />
               <arg evaluator="xml" expression="get-property('query.param.last_name')" />
            </args>
         </payloadFactory>
         <respond />
      </inSequence>
   </resource>
</api>

You will get a similar result as in earlier.

2. Reading path params

In order to read path params, we have to set the resource path dynamically. Ex: /{name}. Then we can read the param value using the get-property function as below.

get-property(‘uri.var.name’)

Try this API service to test the theory.

<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ws.apache.org/ns/synapse" name="ParamAPI" context="/params">
   <resource methods="GET" uri-template="/{name}">
      <inSequence>
         <payloadFactory media-type="json">
            <format>{"HI":"$1"}</format>
            <args>
               <arg evaluator="xml" expression="get-property('uri.var.name')" />
            </args>
         </payloadFactory>
         <respond />
      </inSequence>
   </resource>
</api>

Invoking the API: https://localhost:8243/params/John

The value ‘John’ set for the /{name} path parameter has been read and set to the response payload.

That’s it then. Now you know how to read query and path params in integration services and use them in the integration flow.

Thanks for reading.

Dilhara Hewamaddumage

Categories
Blog

WSO2 EI – Header Based Routing

WSO2 Enterprise Integrator (EI) facilitates more than one option of routing messages. One of such approaches is to route the request based on its transport headers. This is a variant of the integration pattern content-based routing but rather than checking the message payload, we will be using transport headers to determine the message destination.

For this article, let’s assume a scenario where there are two backend services such that one accepts and responds to JSON messages whereas the other one accepts and responds to XML messages. The integration service will check a  ‘Content Type’ of the message and forward the request to the corresponding backend service.

We can use the below switch mediator configuration to achieve the above use case.

<switch source="$trp:Content-Type">
   <case regex="application/json">
      <send>
         <endpoint>
            <http uri-template="http://run.mocky.io/v3/dce12279-030d-4190-805c-8a48d5997fec" />
         </endpoint>
      </send>
   </case>
   <case regex="application/xml">
      <send>
         <endpoint>
            <http uri-template="http://run.mocky.io/v3/029baaef-a803-486e-a4ad-1ecb1ca0e04a" />
         </endpoint>
      </send>
   </case>
   <default>
      <payloadFactory media-type="json">
         <format>{"Error":"Unsupported Content Type"}</format>
         <args />
      </payloadFactory>
   </default>
</switch>

Alternatively, we can configure the switch mediator below as well.

<switch source="get-property(‘transport’,’Content-Type’">
…
</switch>

But using the synapse xpath variable $trp works better when accessing transport headers [1].

Here is the complete API service with the above switch mediator logic.

<?xml version="1.0" encoding="UTF-8"?>
<api xmlns="http://ws.apache.org/ns/synapse" name="TestAPI" context="/routing/header">
   <resource methods="POST">
      <inSequence>
         <switch source="$trp:Content-Type">
            <case regex="application/json">
               <send>
                  <endpoint>
                     <http uri-template="http://run.mocky.io/v3/dce12279-030d-4190-805c-8a48d5997fec" />
                  </endpoint>
               </send>
            </case>
            <case regex="application/xml">
               <send>
                  <endpoint>
                     <http uri-template="http://run.mocky.io/v3/029baaef-a803-486e-a4ad-1ecb1ca0e04a" />
                  </endpoint>
               </send>
            </case>
            <default>
               <payloadFactory media-type="json">
                  <format>{"Error":"Unsupported Content Type"}</format>
                  <args />
               </payloadFactory>
            </default>
         </switch>
         <respond />
      </inSequence>
   </resource>
</api>

After deploying the API service, we can test it using messages with different content types.

JSON:

{“Request”:”JSON Message”}

XML:
<Request>XML Message</Request>

The switch mediator has read the Content-Type header and directed the request to the corresponding backend. If the Content-Type header does not exist or match with any of the cases it will execute the <default> block.

Similarly, you can configure the above API to read a custom header as well.

<switch source="$trp:CustomHeader">
…
</switch>

It allows you to achieve more advanced header-based routing use cases.

We hope the article is clear enough to follow and you will learn something from it. You can find more of such content from our blog section.

Thanks.

Dilhara Hewamaddumage