Working with the Sample Project

The plug-in packages a sample project with the installer. The sample project shows how TIBCO ActiveMatrix BusinessWorks Plug-in for Big Data works.

After installing the plug-in, you can find the samples.zip file in the TIBCO_HOME/bw/palettes/bigdata/version_number/Samples directory.

This sample project contains one process and a subprocess.

  • DemoWorkflow.bwp

    The DemoWorkflow.bwp process is a main process. It shows how to operate HDFS files, transfer files between HDFS and a local directory, create a Hive table, and query data.

    The DemoWorkflow.bwp process contains the following activities:

    Activity Description
    Timer Starts the process when the specified time interval expires.
    RemoveExistingFiles Deletes the customers.csv file from the user/hdfs/bwdemo directory in HDFS.
    CopyDataToHDFS Copies the customers.csv file from the TIBCO_HOME/bw/palettes/bigdata/version_number/Samples/samples.zip/SampleData directory to the user/hdfs/bwdemo directory in HDFS.
    CreateHiveTableRefertToData Creates an external Hive table named customers in HDFS.
    CheckError Performs the subprocess.

    If no error occurs when the ErrorHandler.bwp process is running, the process goes to the HiveQuery activity.

    If any error occurs, the process goes to the Generate-Error activity.

    HiveQuery Queries 100 records from the customers.csv Hive table created by the CreateHiveTableRefertToData activity.
    Generate-Error Generates error messages from the Output tab of the ErrorHandler.bwp subprocess.
    Catch Catches error messages and displays in the Output tab when any error occurs in the DemoWorkflow.bwp process.
    End Ends the process.
  • ErrorHandler.bwp

    The ErrorHandler.bwp is a subprocess of the DemoWorkflow.bwp process.

    The ErrorHandler.bwp subprocess contains the following activities:

    Activity Description
    Start Starts the process.
    WaitForJobCompletion-Activity Waits for the CreateHiveTableRefertToData activity to complete the job.
    ReadResult Reads the output of the job executed by the CreateHiveTableRefertToData activity, which is in the user/hdfs/hive/createstatus/stdout directory.
    ReadError Reads error messages of the job executed by the CreateHiveTableRefertToData activity, which is in the user/hdfs/hive/createstatus/stderr directory.
    Reply Sends a message in response to the ErrorHander.bwp process and the ErrorHander operation.
    Reply1 Sends a message in response to the ErrorHander.bwp process and the ErrorHander operation.
    Generate Error Generates error messages from the Output tab of the ReadError activity.
    Catch Catches the error messages and displays in the Output tab when any error occurs in the ErrorHandler.bwp subprocess.
    RenderXML Renders the error messages in XML string.
    End Ends the process.