Tibco Tutorial Tibco Variables

Tibco: Assign Activity VS Mapper


In this TIBCO tutorial we will understand the use of Tibco Process Variable/Assign Activity over Tibco Mapper Activity with the help of an example.
Process Variable/Assign Activity Vs Mapper Activity


  • The primary purpose of an assign task is to store a variable at a process level. Any variable in an assign task can be modified N times in a process. But a mapper is specifically used for introducing a new variable. We cannot change the same mapper variable multiple times in a project.
  • Memory is allocated to Process Variable when the process instance is created but in case of tibco Mapper the memory is allocated only when the mapper activity is executed in a process instance.
  • Process Variable is allocated a single slot of memory which is used to update/modify the schema thought the process instance execution i.e. N number of assign activity will access same memory allocated to the variable. Whereas using N mapper for a same schema will create N amount of memory.
  • Assign Activity can be is used to accumulate the output of a tibco activity inside a group.

Example


Below is the Tibco Bw example to explain the use of tibco Process Variable/Assign Activity over Mapper:

Tibco Process Design

Requirement
We want to accumulate all the error output for the JDBC activity inside the group and write it to Write File.

Error Path
In this Tibco bw process, if instance is unable to connect to DB or in case of error inside the group; the group “Repeat On Error Until True” will re-execute again and again until the error exists max of 5 times. After which the group will exit and Write File will write the latest error generated by JDBC activity. (Only latest JDBC error is record)

Solution
Here using Mapper activity wont be of any use as we cannot change the same mapper variable multiple times in a project. Thus we can us assign activity to solve this problem.

Tibco Process Design



Assign Activity Configuration


Here in the above solution we created a schema for the Process Variable “JDBCErrorVar” to record error message and error code.When the error occurs in JDBC Query for the first time, Assign Activity will assign the error message and error code to the process variable and now the process variable has only the first JDBC error output stored.When the group runs for the 2nd time and error occurs in JDBC Query, Assign Activity assign the error to the process variable again. Now Assign activity has the first and second error.

Thus we are able to accumulate the output when ever the group execute and there is a JDBC error.

Assign Activity Data Stored


About Varun Goel

Varun Goel is a technology enthusiast with 6+ years exp in IT industry. In fact, he is been developing application after schooling as freelancer. Currently working with one of the Fortune’s 100 Companies having vast experience Mule ESB, Tibco, HTML5, CSS, JSS, Android, Core Java, JSP, PHP, MySQL, AutoCAD, Maya, ZBrush, Photoshop, Flash CS and many more.

Leave a Reply

Your email address will not be published.