BuildForge Help

.source, .defect, .test, .pack commands

.source interfacename interface_element_name

You can use these dot commands to run an adaptor from a step within a project. The command runs a single named <interface> element within an adaptor. Using this command, you can launch individual interfaces within your adaptor file to create output in the bill of materials (BOM) or perform other actions.

The interfacename is the name of a previously-defined adaptor created on the Projects > Adaptors page.

The interface_element_name is the name attribute of an <interface> element within the adaptor.

For example, to run the <interface name="ByDate"> section of a ClearCase adaptor you created named MyClearCase, use the command
.source MyClearCase ByDate

Adding New Functions to an Adaptor

You can add new <interface> entry points to an interface to provide new functions. To add a new entry point:

  1. Edit the adaptor. Select Projects > Adaptors, then click the name of an adaptor from the list.
  2. Add a new <interface> element. You may want to copy an existing <interface> element (and its subelements) and edit the name property of the <interface>.
  3. Add <command> and <bomformat> elements as needed.
    • If you add new command lines, you must define them in <command> elements.

    • If you add a new section to the BOM, you must add a <bomformat> element to define it.

Sample Interface XML

The following example shows a simple standalone interface. It executes a command and copies its output to the BOM in a section named Defects. You can create an interface like this one by adding an adaptor to the list on the Projects > Adaptors page, then editing the adaptor and replacing its XML content with the text shown below. You can then edit the content to run any desired commands to produce output from your source control system.

<?xml version="1.0"?>

<!DOCTYPE PROJECT_INTERFACE SYSTEM "interface.dtd">
<PROJECT_INTERFACE>
 <interface name="AddBom">
  <run command="add_bom" params="$DefectNumber $TestType $State" server="$BF_SERVER" dir="/" timeout="360"/>
 </interface>
 <command name="add_bom">
  <execute>
   echo $1 $2 $3
  </execute>
  <resultsblock>
   <match pattern="^(.*?)\s(.*?)\s(.*?)$">
    <bom category="Defects" section="defect">
     <field name="id" text="$1"/>
     <field name="testtype" text="$2"/>
     <field name="state" text="$3"/>
    </bom>
   </match>
  </resultsblock>
 </command>
 <bomformat category="Defects" title="Defects">
  <section name="defect">
   <field order="1" name="id" title="ID"/>
   <field order="2" name="testtype" title="Test Type"/>
   <field order="3" name="state" title="State"/>
  </section>
 </bomformat>
</PROJECT_INTERFACE>
Related concepts
.source
.defect
.pack
.test