Working with Sample Projects

To understand how ActiveMatrix BusinessWorks Plug-in for OSIsoft PI System works, you can run the sample projects packaged with the installer, which are located in the TIBCO_HOME/bw/palettes/pi/version/samples directory.

The Example_AF Sample Project

The Example_AF sample project demonstrates the usage of the PI Data Archive server connection and the AF activities.

Note: You must configure the OSIsoft PI System AF connection correctly to run the PIAF process.
The Example_AF sample project contains two processes:
  • PIAF.bwp, which shows how to use the AF activities to:
    • Create and modify tags.
    • Retrieve tag definitions.
    • Set tag values.
    • Retrieve tag values, including the latest tag value, the archival value with a specified timestamp, the historical values within a specified time range, and a specified number of historical values.
  • PIEventListener.bwp, which shows how to use AF Activity to:
    • Register Tags with or without using bulk tag registration feature.
    • Listen on the registered tags for any event.
  • PIEventListenerTagRegistrationWithAFAttribute.bwp, which shows how to use AF activities to:
    • Listen on tag updates.
    • Fetch changed entries.
    • Perform bulk tag registration from AFAttributes.
  • PIEventListenerTagRegistrationWithFile.bwp, which shows how to use AF activities to:
    • Listen on tag updates.
    • Fetch changed entries.
    • Perform bulk tag registration from file.

The Example_AFAssets Sample Project

The Example_AFAssets sample project demonstrates the usage of PI AF server connection and the AF Assets activities.

Note: You must configure the OSIsoft PI System AF connection correctly to run the processes in the PIAF process.
The Example_AFAssets sample project contains one process, AFAssetsSearch.bwp, which shows how to use the AF Assets activities to:
  • Search AFElement objects.
  • Search AFElement objects and their respective attributes.
  • Search AFAttribute objects.

The Example_AFSDK Sample Project

The Example_AFSDK sample project demonstrates the usage of PI AF server connection and the AF AttributeEventListener activity.

Note: You must configure the OSIsoft PI System AF connection correctly to run the processes in the PIAF process.

The Example_AFSDK sample project contains two processes, PIAFAttributeEventListener.bwp and PIAFAttributeEventListenerWithFile.bwp.

  • PIAFAttributeEventListener.bwp, which describes how to use AF Activity to:
    • Register AFAttributes with or without using the bulk tag registration feature.
    • Listen on the registered AFAttributes for any event.
  • PIAFAttributeEventListenerWithFile.bwp, which describes how to use AF activities to:
    • Listen on AFAttribute updates.
    • Fetch changed entries.
    • Perform bulk AFAttribute registration from a file.

The Example_JDBC Sample Project

The Example_JDBC sample project demonstrates the usage of the JDBC connection and the JDBC Query activity.

Note: You must configure the OSIsoft PI System JDBC connection correctly to run the processes in the Example_JDBC sample project.
The Example_JDBC sample project contains the following processes, and each process corresponds to a task:
  • getArcvalues.bwp

    This process shows how to use the JDBC Query activity to get a specified number of historical tag values within a specified time range.

  • getSnapshot.bwp

    This process shows how to use the JDBC Query activity to get the latest tag value.

  • getTagDefinition.bwp

    This process shows how to use the JDBC Query activity to get tag definitions.

  • getValueHistory.bwp

    This process shows how to use the JDBC Query activity to get historical tag values.

  • PIJDBC.bwp

    This process shows how to use the JDBC Query activity to:

    • Get tag definitions.
    • Get the latest tag value.
    • Get the historical tag values within a specified time range.
  • PIJDBCTagDefinition.bwp

    This process shows how to use the JDBC TagDefinition activity to:

    • Create tags.
    • Modify tag value.
  • SetTagValues.bwp

    This process shows how to use the JDBC Query activity to set the tag values.