Showing posts with label Business Works. Show all posts
Showing posts with label Business Works. Show all posts

Perform upgrade of TIBCO components / Migration from TIBCO BW 5.X to 5.Y

These are the example steps for migrating from domain "OLD" to domain "NEW".

1.We have a writable directory to export the applications to. Let's call it $BATCHDIR.

2.We should know the actual username and password for the old and new domains.

3.Make sure both domains are running.

4.cd to $TRA_HOME/tra/<ver>/bin/ , lets say /utils/tibco/tra/5.3/bin/

5.Use this command to create a batch file and export .ear files and configuration files: "AppManage -batchExport -domain OLD -user tibco -pw tibco -dir $BATCHDIR "

6.To import all of the applications without starting them, use this command: "AppManage -batchDeploy -domain NEW -user tibco -pw tibco -dir $BATCHDIR -nostart"

If we want to automatically start the applications after deploying, leave off the -nostart parameter. If we don't want to deploy all the applications, modify the $BATCHDIR/AppManage.batch file by commenting or deleting the applications we don't want to deploy.

Typically after we do the batch deploy, we manually stop all of the engines in the old domain, then manually start the engines in the new domain, then stop the old domain itself. This leaves the old domain intact in case something went wrong with the deployments, but it no longer uses any resources.

Business needs may require us to have an engine running at all times, so we could start the new engines before stopping the old engines, but we should make sure they will not conflict with each other first.

Improvements to the AppManage utility in TRA version 5.3 give even more control over working with multiple engines.

Pain points which needs to put light in migration

Is all the Services are scripted deployed or not, in OLD domain?
If few of them manual deployment How to go about it?
How to convert everything to Scripted deployment going forward to ease further enhancements?
Memory Issues (Physical as well as RAM), System requirements due to migration?
Get to know the Basic difference of versions (old and new), e.g. Kind of repository used?
What causes engine startup error due to migration?
How to automate these entire process?
Can be divided into sections Export, Process & Import ?
Is services falls under LB as well as FT?
What are all adapters involved?
Carefully diagonize the difference this is where you end up more processing ?







 

Difference between Inter Process Communication and main process & sub process Communication (using called and calling)

When you excute a "Call Process" task, you just execute another process in the same engine and thread, and wait for its completion. It is like calling a method/function in a standard language.

If in this task, you select the "Spawn" option, the other process will be executed in parallel, in the same engine, but in another thread. The task will complete without waiting for the process completion. This can be used if you want to start a separate process running in parallel.

Now you will use the "Notify" task to send a notification from a process (A) to another one (B) running separately in parallel in different threads. The other process (B) uses the "Wait Notify" task to wait for a notification from another process (A).

In order to work, both A and B notification tasks require a shared configuration object: a "Notify" configuration object. This one can define an XML schema, so processes using this configuration can pass data (from A to B).

The "Notify" configuration object, by default, works for processes running in the same TIBCO BusinessWorks engine. A BW engine is a Operating System process running its own Java Virtual Machine and running a set of BW processes, started by events. Each engine is a separate process at the OS level.

If you want to pass data from one engine to another process in another separate engine, you will select the "Multi-Engine" option of the "Notify" configuration object. In this case, both engines need to access the same database, where TIBCO BusinessWorks stores the data passed from one engine to another one. This mode of communication is slow and requires a database.

Generally, to communicate between separate engines in an efficient and flexible way, you are better consider proper SOA and EAI communication transports and formats, such as SOAP over HTTP/HTTPS/JMS, XML over HTTP/HTTPS/JMS/Rendezvous, etc...

The notification between separate engines is something to consider as last possibility and to be used only for synchronization: for example, execute something only when something else is finished somewhere else.


How can create custom process starters in TIBCO AMBW ?

 Custom process starters can also be created.

 The Java Event Source process starter allows to create a custom process starter based on Java code.

 Java Event Source provides the features (such as Sequencing key) of other process starters without the need to write extra code.

 Java Event Source provides an abstract class to extend to create a process starter. The abstract class describes the methods that interact with the process engine. 

Custom code must provide implementation for the methods,

 init(). Called when the process engine starts. Can initialize any resource connections. Specify a Java Global instance on the Advanced tab that initializes resource connections. Java Global instances are loaded and initialized during process engine start up. this.getJavaGlobalInstance() can be executed to obtain the Java Global Instance resource in process starter code.

 onStart(). Called by the process engine to activate the process starter. This method must activate any event notifier or resource observer code. The notifier or observer code can then call the onEvent() method to start a process instance.

 onStop(). Called by the process engine to deactivate the process starter. This method must deactivate any event notifier or resource observer code.

onShutdown(). Called by the process engine when the engine shuts down. The method should release any resources and resource connections and perform any required clean up operations.

Methods already implemented.

onEvent(Object object). Called when a listener or resource observer catches a new event. Input to this is a Java object containing the event data.

getGlobalInstance(). Returns an object reference to the Java Global resource specified on the Advanced tab of the process starter. Useful when initialization code is placed in a Java Global Resource instead of the init() method.

onError(). Throws the exception specified in the input parameter. Used to propagate an error to the TIBCO ActiveMatrix BusinessWorks process instance when a listener or resource observer fails to generate an event.

How to create a Custom palette with Custom activities ?

Creating a Custom palette with Custom activities.

1. Create a Custom palette

    a) Select Palettes > My Palettes > New Palette from TIBCO Designer menu.
    b) Specify a name in the dialog that appears
    c) Custom palette appears in palette panel.

2. Drag and drop custom activity to custom palette.
3. Save the project

Distributing custom palette

1. Locate the file(s) containing the custom palette(s) which, by default, are stored in the location specified in the User Palette Directory foeld of the General User Preferences dialog. The file extension of the custom palette is .mypalette.

2. Copy the .mypalette file to the custom palette directory on the machines to use the custome palette. An installation program may be created to perform this step so that users can easily install the custom palettes.

3. Start TIBCO Designer and click the MyPalettes tab to see the custom palette. If TIBCO Designer is already running, click on Palettes > My Palettes > Reload Palettes from the menu to retrieve the new custom palette.
  • Custom activities behave like any other activity in TIBCO ActiveMatrix BusinessWorks. The name of the Custom Activity and the name of the process definition in which the Custom Activity is included should be unique. If names are the same, input and output schemas are not displayed.
  • Global Variables used in Custom Activity are automatically added to the Global Variable list in the project (if they are not included yet).
  • When tracing is enabled, the trace information for activities executing within a custom activity is written to a log file. 


How to create 'Custom Activity' in Active Matrix Business Works ?

TIBCO BW > General Activities >  "Custom Activity"  Configuration

A process definition can be packaged into a custom activity that hides the implementation details of the process from the user.

Steps for creating a custom activity.

1. Create a folder (uniquely named is strongly recommended)

2. Create a process definition

3. Optionally, create output schema to the process definition Start activity.

4. Implement business logic for process definition.

5. Optionally, specify input schema for the End activity in the process definition and mapping.

6. In the project panel, click on the root node of the project, then select the General Activity palette in the palette panel.

7. Create a Custom Activity resource.

8. Click on Browse button to select the process definition.

9. Click Apply.

10.Take one new process definition to use this Custom Activity resource which is configured in previous steps.

(By drag & drop this configured Custom Activity resource cannot use in new process definition, we need to copy the configured Custom Activity resource and past inside the new process definition)

11.Once this done,then the resource is loaded into the new process definition,so now we can run this process.

Any resources referenced by the process definition in a custom activity are automatically included in the custom activity. 

Dynamically called subprocesses are not known at design time, and therefore are not referenced by the process definition. 

Therefore, dynamically called subprocesses cannot be used by a process definition within a custom activity.

Only process definition that do not have a process starters can be referenced by a custom activity.

Global variables used within the process definitions referenced by custom activities are automatically added to the global variable list of the project when the activity is added to a process definition.

Thus a naming convention for Global variables should be specified.

WSDL or XSD files are not automtically included when the process definition is placed in a custom activity. 

WSDL and XSD files must be made available to any user of custom activity.



Scenario - How to do convertion of XML to .txt or CSV file using TIBCO-BW ?

If we got an XML file and from this xml ,How can print only its content (tag values) as text string and send this content to specific address using mail.

This Requirement can achieve in TIBCO BW process using this below activities

1. If we have xml file then use Read File activity to get xml string.

2. This XML String is passed to XSLT Style sheet in a XML Transform pallete.

3. In XLST file, Output method is defined as "text", hence output data obtained is of "text" i.e. it will not contain any HTML tags.

4. Then a Write File activity is called, and the output of XML Transform is passed as 'text Content', hence the CSV/txt file gets generated of type like

DATA-1.1 , DATA-1.2 , DATA-1.3
DATA-2.1 , DATA-2.2 , DATA-2.3


5. Later Send Mail activity is called, here at Input tab, File Name is selected under mimeHeader, File Name is given as file created in previous step.

Example XML file and style sheet for the above scenario testing given below.

Here given xml ,Just save this xml as file and use Read File activity to get into BW.

Also here given style sheet ,Use this to configure XSLT file (shared Resource) for Transform XML activity.

-------------------------------------------------------------------
  <employee_list>
    <employee>
        <name>George</name>
        <dept>HR</dept>
        <phone>044-123-4567</phone>
        <email>ex@example.com</email>
    </employee>
    <employee>
        <name>Jones</name>
        <dept>Sales</dept>
        <phone>011-122-2233</phone>
        <email>axe@example.com</email>
    </employee>
    <employee>
        <name>Taylor</name>
        <dept>Engineering</dept>
        <phone>040-111-2333</phone>
        <email>abc@example.com</email>
    </employee>
</employee_list>
 
-------------------------------------------------------------------

Example stylesheet for the conversion of XML to Text string

-------------------------------------------------------------------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="text" />
 <xsl:template match="/">
  <xsl:apply-templates />
  </xsl:template>
 <xsl:template match="employee_list">
  employee Directory for example.com
  <xsl:apply-templates />
  </xsl:template>
<xsl:template match="name">
  Name:
  <xsl:apply-templates />
  </xsl:template>
 <xsl:template match="dept">
  Dept:
  <xsl:apply-templates />
  </xsl:template>
 <xsl:template match="phone">
  Phone:
  <xsl:apply-templates />
  </xsl:template>
 <xsl:template match="email">
  Email:
  <xsl:apply-templates />
  </xsl:template>
  </xsl:stylesheet>

-------------------------------------------------------------------


What is the use of Check Point activity ?


To detect duplicate messages, it is important to place the Checkpoint activity before any activities that we do not want to execute more than once.

We must specify a value for the duplicateKey element in the Checkpoint activity input schema.

This value should be some unique key contained in the event data that starts the process.

How it works ?

For example, the TransactionID value is unique for all new orders.

The following describes the procedure for duplicate detection by the process engine:

1. An incoming message is received and a process instance is created.

2. Activities in the process instance are executed until the first Checkpoint activity is reached. The Checkpoint activity has a value specified for the duplicateKey input element.

3. The process engine checks the current list of duplicateKey values for a matching value.

a. If no process instance has stored the given duplicateKey value, the process engine stores the value and completes the Checkpoint activity.

b. If another process instance has already stored the given duplicateKey value, then process engine terminates the process and throws a DuplicateException.

Process Engine Properties for Duplicate Detection

The following process engine properties need to set in bin/bwengine.xml to control duplicate key detection.

• bw.engine.dupKey.enabled —

specifies whether duplicate detection is performed.

true (the default) - indicates the process engine will check for identical duplicateKey values.

false -indicates duplicateKeys when specified are ignored.

• bw.engine.dupKey.timeout.minutes —

 specifies how long (in minutes) to keep stored duplicateKey values.

The default is 30 minutes.

Value -1 indicates the duplicateKey values are deleted when the job completes.

Value 0 indicates to store duplicateKey values indefinitely.

Any positive integer greater than 0 indicates the number of minutes to keep stored duplicateKeys.

• bw.engine.dupKey.pollPeriod.minutes —

specifies the number of minutes to wait before polling for expired duplicateKey values.


Principles of SOA

There is a common set of principles most associated with service orientation.

As a result of research the author performed for SOA Systems (during which service orientation, as a design paradigm, was studied within the context of all major vendor platforms and existing frameworks and blueprints) this set of common service-orientation principles has been identified and defined. 

Below are brief descriptions of each. 

Services are autonomous — The logic governed by a service resides within an explicit boundary. The service has control within this boundary, and is not dependent on other services for it to execute its governance. 

Services share a formal contract — In order for services to interact, they need not share anything but a collection of published metadata that describes each service and defines the terms of information exchange. 

Services are loosely coupled — Dependencies between the underlying logic of a service and its consumers are limited to conformance of the service contract. 

Services abstract underlying logic — Underlying logic, beyond what is expressed in the service contract metadata, is invisible to the outside world. 

Services are composable — Services may compose others, allowing logic to be represented at different levels of granularity. This promotes reusability and the creation of service abstraction layers. 

Services are reusable — Regardless of whether immediate reuse opportunities exist, services are designed to support potential reuse. 

Services are stateless — Services should be designed to maximize statelessness even if that means deferring state management elsewhere. 

Services are discoverable — Services should allow their descriptions to be discovered and understood by humans and service requestors that may be able to make use of their logic. 

Of these eight, autonomy, loose coupling, abstraction, and the need for a formal contract can be considered the core principles that form the baseline foundation for SOA, directly supporting the realization of others (as well as each other).

What is SOA - Service Oriented Architecture ?

"Separation of concerns" is an established software engineering theory based on the notion that it is beneficial to break down a large problem into a series of individual concerns. 

This allows the logic required to solve the problem to be decomposed into a collection of smaller, related pieces. Each piece of logic addresses a specific concern.

This theory has been implemented in different ways with different development platforms. Object-oriented programming and component-based programming approaches, for example, achieve a separation of concerns through the use of objects, classes, and components. 

Service orientation can be viewed as a distinct manner in which to realize a separation of concerns. The principles of service orientation provide a means of supporting this theory while achieving a foundation paradigm upon which many contemporary SOA characteristics can be built.

Difference between SOAP over HTTP and SOAP over JMS?

Reason for choosing JMS in most cases is reliability. But there are other things that come in mind whether to choose JMS or HTTP.

Reasons to go with HTTP:
  • Firewall friendly (web services exposed over internet)
  • Supported on all platforms (easiest connectivity in b2b scenario)
  • Clients can be simple and lightweight
Reasons to go with JMS:
  • Assured delivery and/or only once delivery
  • Asynchronous support
  • Publish/subscribe
  • Queuing if better for achieving larger scalability and reliability
  • Better handles temporary high load
  • Large volume of messages (EDA)
  • Better support in middleware software
  • Transaction boundary
In SOA architecture best practice is to use JMS internally (for clients/providers that can easily connect to ESB) and HTTP for connecting to outside partners (over internet).

Using SOAP over JMS gives  some advantages compared to HTTP, 

specially related to reliability as you may use the persistence and acknowledgment features built in the standard. 

The same applies if you need to establish asynchronous communication or need to use the load balancing features provided by JMS servers.

We can achieve this using http but the implementation would be much more complicated.

If we do SOAP over JMS, in fact we can do load balancing..  where as with SOAP over HTTP requires additional hardware like IP Sprayers.

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Back to TOP