Welcome!

Weblogic Authors: Yeshim Deniz, Elizabeth White, Michael Meiner, Michael Bushong, Avi Rosenthal

Related Topics: Weblogic

Weblogic: Article

A Real-World Business Process Model

Using the WebLogic platform for order management - Part 3

In Part 1 (Vol. 3, issue 6) of this series I gave you an overview of business process management (BPM) and covered the specifications in this area. I described the order change example and the steps needed to create the business process in WebLogic Integration. In Part 2 (Vol. 3, issue 7), we created a process application - orderChange. In this application we created a new process called orderChange.jpd. To start the process we added a ClientRequest received. Then we added the Web service validate config.

This month we will add a decision point to handle the result from validate config Web service. The decision point helps in handling both the positive and negative outcomes of the result from the process. Then we will add a database control to check the status of the order to be changed and lastly, we will add another decision node to handle the result from the database Control.

Add a Decision Node
When the validate config process node is executed we have two results - one that the product is valid and the other that it is not valid. To decide what to do with the two results we need to add a decision node in the business process. If the configuration is valid, the process will proceed; otherwise, it will end. To add this node, click Decision in the palette, and drag-and-drop the decision node onto the business process in design view, as shown in Figure 1.

You need to define a condition in this decision node. To do this, double-click the condition node to invoke the decision builder. Variable is selected by default. You should use variable as you design the decision based on the value of an element in an XML document namely status, which is valid against an XML Schema. Select the XML element on which the decision is made. To do so, you need to select the attribute status from outValidateConfig. Select the = operator from the Operator list and enter true in the Right Hand Expression field. Click Add to add the condition you just created (BEA) -


data($outValidateConfig/ns:Status)= "true"

This completes the design of the first condition on this node. Figure 2 shows that if the validateConfig status is true, you can go to the next step; if the decision is false, the process ends. During runtime the decision point is evaluated to determine the path of the process.

Add a Database Control
If the configuration is valid the process goes to the next step, which is executed through a database control. Database controls are part of the control framework. (We talked about the control framework in the last article.)

You need to add a database control to the process. The database control provides access to a database containing orderStatus for a particular AccountID. This control sends the AccountID to the database table ORDERSTATUS, which sends a response to reflect whether the order is changeable. You can access a relational database through a database control from your application. Using the database control, you can issue SQL commands to the database which accesses the database through the JDBC driver. You must specify a data source that is configured in WebLogic - in this example, it is cgdatasource. The database control automatically performs the translation from database queries to Java objects so that you can easily access query results.

First you will create a new Java class called record.java. The Record class is a Java object that represents an individual record within a database. In particular, it represents an individual record of the ORDERSTATUS table in the database. This is the code to add to record.java:


public class Record
{
    public String orderStatus;
}

Create a database control file that queries the ORDER STATUS table and then returns a record object containing the results of the query. This database control file is called OrderStatus DB.jcx. JCX stands for Java Control extension. A JCX file extends one of WebLogic Workshop's prebuilt control classes. In this case, it is the com.bea.control.DatabaseControl class, which offers easy access to a database. Most of the built-in controls provided with BEA WebLogic Workshop are customizable - that is, when you add a new built-in control to a project, WebLogic Workshop generates a JCX file that extends the control. In some cases - such as with the database control or the JMS control - you can customize the control by adding or editing methods defined in the JCX file. WebLogic Workshop customizes the EJB control for you based on the EJB that the control will be accessing.

Now add a method named getOrder Status to the database Control file OrderStatus DB.jcx. Then add a SQL query to the method in the property editor, as shown:


SELECT ORDER_STATUS FROM ORDERSTATUS WHERE ACCOUNT_ID={accountId}

In the Java pane, this change is reflected in the method:


public Record getOrderStatus(String accountId)

In source view, the code shows that by passing the AccountID, you get the order_status from the database table ORDERSTATUS (see Listing 1).

To pass the AccountID from the XML received from the client to the database control a transformation is used. This transformation maps the AccountId from the received XML to the AccountID sent by the database control. Once the order status is obtained, as shown in Listing 1, it can be sent to the next node in the process.

Add Another Decision Node
The next step is to check whether the orderStatus result allows for the order to be changed. For this, insert another decision point. To make the decision here, use a Java method instead of a variable. To use a Java method, select a method as shown in Figure 3. Select condition in the Java method name. If the condition's return value is boolean, as shown in the code below, then the order is changeable. If the order is changeable, go to the next step; otherwise, stop the process.


public boolean condition()
    {
       record = "OK";
    return true;
	}

Summary
In this article we have seen how the first decision node is added to the process. This node helps to handle the two results obtained from the validate config Web service, namely whether the configuration is valid or not valid. If the configuration is valid, the process calls the next node, which is a database control.

We also looked at the details of creating and adding a database control that checks the database for the order status. This order status will determine if the order is changeable. Then we added a decision to handle the result of the output from the database control.

In my next article we will see if the order status is changeable and how we write this change to a file. This change can then be uploaded to an ERP system like SAP and the order can be changed. In the final article in this series, we will see how this process is executed and monitored.

References

  • BEA WebLogic Workshop Help: http://e-docs.bea.com/workshop/docs81/doc/en/core/index.html
  • More Stories By Anjali Anagol-Subbarao

    Anjali Anagol-Subbarao works in HP's IT organization as an IT architect. She has 12 years of IT experience, the last five in Web services. Her book on J2EE Web services on BEA WebLogic was published in October 2004.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


    IoT & Smart Cities Stories
    In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
    Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...
    Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
    Nicolas Fierro is CEO of MIMIR Blockchain Solutions. He is a programmer, technologist, and operations dev who has worked with Ethereum and blockchain since 2014. His knowledge in blockchain dates to when he performed dev ops services to the Ethereum Foundation as one the privileged few developers to work with the original core team in Switzerland.
    René Bostic is the Technical VP of the IBM Cloud Unit in North America. Enjoying her career with IBM during the modern millennial technological era, she is an expert in cloud computing, DevOps and emerging cloud technologies such as Blockchain. Her strengths and core competencies include a proven record of accomplishments in consensus building at all levels to assess, plan, and implement enterprise and cloud computing solutions. René is a member of the Society of Women Engineers (SWE) and a m...
    Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...
    Whenever a new technology hits the high points of hype, everyone starts talking about it like it will solve all their business problems. Blockchain is one of those technologies. According to Gartner's latest report on the hype cycle of emerging technologies, blockchain has just passed the peak of their hype cycle curve. If you read the news articles about it, one would think it has taken over the technology world. No disruptive technology is without its challenges and potential impediments t...
    If a machine can invent, does this mean the end of the patent system as we know it? The patent system, both in the US and Europe, allows companies to protect their inventions and helps foster innovation. However, Artificial Intelligence (AI) could be set to disrupt the patent system as we know it. This talk will examine how AI may change the patent landscape in the years to come. Furthermore, ways in which companies can best protect their AI related inventions will be examined from both a US and...
    Bill Schmarzo, Tech Chair of "Big Data | Analytics" of upcoming CloudEXPO | DXWorldEXPO New York (November 12-13, 2018, New York City) today announced the outline and schedule of the track. "The track has been designed in experience/degree order," said Schmarzo. "So, that folks who attend the entire track can leave the conference with some of the skills necessary to get their work done when they get back to their offices. It actually ties back to some work that I'm doing at the University of San...
    When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...