martes, 27 de octubre de 2015

TIBCO BusinessWorks. Sample 1: Global Variables and Properties Files

A BW X process invokes n times to another process BW Y. The number of times the process X calls the process Y is set in a global global variable whose value is set in the property file.

Steps:

1.    Create a BW project
             a.    Create a folder “VariableGlobal_FichProp”
             b.    Start TIBCO Designer
                        i.    Create a new BW project




                       ii.    Select the forder you have created before



                       iii.    Click “OK”

2.    Create the global variable “n” whose value will be set in the property file:
                  a.    Select the tab “Global Variables” in IBCO Designer and open the editor clicking on the icon:


             
                      b. Add the group variable “ejemplo1” clicking the icon



                      c.    Inside the group create the variable “n” clicking on "abc" icon. Set   “_PROPFILE_” as text value for the variable. This value indicates that the value of the variable is obtained from a properties file.



                           Click on OK

                     d.    In the “VariablesGlobales_FicherosPropiedades” folder, add a new definition process. Set “Proceso_VariableGlobal_FichProp” as process name and click “Apply”.






                       e.    doble click over the process definition.



                      f.    Create a process variable “i”.
                                  a.    In the section “Process Variables”
                                  b.    Asign the value “i” to the field “name”
                                  c.    Add the integer element “i”
                                  d.    Apply and save



                      g.    Add a task “WriteToLog” from the “General Activities” pallete



                              With this taks the console will show the number of itarations.

                              a.    Configura the task “Log”. Assing to the “message” field the value “concat(“i: “,$i/i)” through the formula editor. Click in the icon








                  h.    Assing a initial value to the variable “i” using the task “Assing” from the  General Activities pallete.
                              a.    Create the “Assing” activity (General Activities  Assing)
                              b.    Slect i into “Process Variable to Set”
                              c.    In the “input” tab asigns the value 0 to the variable “i”






                             d.    Click on “Apply”
                 i.    Create a group for the task "Log". Select the “Log” activity and click on the create group icon. 






                             a.    Click on the group icon and select “Repeat-Unti-True”.
                             b.    Set the “Index Name” field with the value “j”
                             c.    Complete the field “condition” with “$i/i=$_globalVariables/pfx:GlobalVariables/ejemplo1/n”. Do this with the formula editor.
                             d.    Press “Apply”




               j.    Configure the log task like the image below.




               k.     Add a new asing activity to add 1 to the variable i.


                              a.    In the “Input” tab add 1 to the precess variable i. Asign the value $i+1.



            l.     Create the propeties file “bwprop-VariableGlobal_FichProp-DEV.prop” in “<dir_home>/CursoTIBCO/configuracion”. Use the file explorer to to this. 





                         a.    Open the file with a text editos and add the next text:

#
# Properties file
#
# Configuration sample 1
#
##########################################################
# Variables
##########################################################
tibco.clientVar.ejemplo1/n=10

                          b.    Save



              m.     To test the sample fo to the Test tab in TIBCO Designer.
                           a.    Click on the icon “Star testing”
                           b.    Select the process “Proceso_VariableGlobal_FichProp”
                           c.    for reference the properties file click on “Advanced” and add the line “-p <dir_home>/CursoTIBCO/configuracion/bwprop-variableGlobal_FichProp-DEV.prop” in the field “Test Engine User Args”.




                         d.    Press “Load Selected”
                         e.    Open the console: Window  Show Console
                         f.    The console shows the fianl log:

2010 Jun 15 17:14:37:890 GMT +2 BW.FormacionAvanzadaBW Info [BW-Core] BWENGINE-300002 Engine FormacionAvanzadaBW started
2010 Jun 15 17:14:39:334 GMT +2 BW.FormacionAvanzadaBW User [BW-User] - Job-1 [Ejemlos/VariableGlobal_FichProp/Proceso_VariableGlobal_FichProp.process/Group/Log]: i: 0
2010 Jun 15 17:14:40:017 GMT +2 BW.FormacionAvanzadaBW User [BW-User] - Job-1 [Ejemlos/VariableGlobal_FichProp/Proceso_VariableGlobal_FichProp.process/Group/Log]: i: 1
2010 Jun 15 17:14:40:702 GMT +2 BW.FormacionAvanzadaBW User [BW-User] - Job-1 [Ejemlos/VariableGlobal_FichProp/Proceso_VariableGlobal_FichProp.process/Group/Log]: i: 2
2010 Jun 15 17:14:41:468 GMT +2 BW.FormacionAvanzadaBW User [BW-User] - Job-1 [Ejemlos/VariableGlobal_FichProp/Proceso_VariableGlobal_FichProp.process/Group/Log]: i: 3
2010 Jun 15 17:14:42:143 GMT +2 BW.FormacionAvanzadaBW User [BW-User] - Job-1 [Ejemlos/VariableGlobal_FichProp/Proceso_VariableGlobal_FichProp.process/Group/Log]: i: 4
2010 Jun 15 17:14:42:866 GMT +2 BW.FormacionAvanzadaBW User [BW-User] - Job-1 [Ejemlos/VariableGlobal_FichProp/Proceso_VariableGlobal_FichProp.process/Group/Log]: i: 5
2010 Jun 15 17:14:43:544 GMT +2 BW.FormacionAvanzadaBW User [BW-User] - Job-1 [Ejemlos/VariableGlobal_FichProp/Proceso_VariableGlobal_FichProp.process/Group/Log]: i: 6
2010 Jun 15 17:14:44:228 GMT +2 BW.FormacionAvanzadaBW User [BW-User] - Job-1 [Ejemlos/VariableGlobal_FichProp/Proceso_VariableGlobal_FichProp.process/Group/Log]: i: 7
2010 Jun 15 17:14:44:988 GMT +2 BW.FormacionAvanzadaBW User [BW-User] - Job-1 [Ejemlos/VariableGlobal_FichProp/Proceso_VariableGlobal_FichProp.process/Group/Log]: i: 8
2010 Jun 15 17:14:45:663 GMT +2 BW.FormacionAvanzadaBW User [BW-User] - Job-1 [Ejemlos/VariableGlobal_FichProp/Proceso_VariableGlobal_FichProp.process/Group/Log]: i: 9


No hay comentarios:

Publicar un comentario