An IssueNet system is very accessible. Options such as a full .NET API and a SOAP API provide limitless integration options for those with the time and expertise. However, a quick-and-dirty option is often preferable. With the absence of an industry standard .NET scripting platform and the general inflexibility of a command line interface, another option is needed. This is where the IssueNet tasks for MSBuild come in. Don't let the name fool you-- MSBuild is as useful for common scripting as it is for building projects.

MSBuild tasks are compiled in .NET dlls, then configured in XML project files, and can be executed from the command line. Standard tasks include Touch, MakeDir, and FindUnderPath. 3rd parties have implemented task libraries with functionality ranging from file access to XML manipulation. IssueNet tasks include the following:

  • ExecuteIssueNetQuery - Execute a stored query in an IssueNet system. The results will populate an MSBuild item.
  • CreateIssueNetObjects - Creates one or more objects in an IssueNet system. The objects are passed in as MSBuild items.
  • UpdateIssueNetObjects - Updates one or more objects in an IssueNet system. The objects are passed in as MSBuild items.
  • LinkIssueNetObjects - Links together two objects in an IssueNet system.
  • TransitionIssueNetTasks - Transitions one or more tasks in an IssueNet system. The objects are passed in as MSBuild items.

These tasks accomplish 90% of what our customers are doing with the full API, and getting up and running is a bit simpler.  The following MSBuild project file executes a query in order to transition tasks:

   1:  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   2:      <UsingTask TaskName="Elsinore.Engine.MSBuild.Tasks.ExecuteIssueNetQuery" AssemblyFile="Elsinore.MSBuild.dll" />
   3:      <UsingTask TaskName="Elsinore.Engine.MSBuild.Tasks.TransitionIssueNetTasks" AssemblyFile="Elsinore.MSBuild.dll" />
   4:   
   5:      <Target>
   6:          <ExecuteIssueNetQuery ConnectionName="$(IssueNetConnectionName)" UserID="$(IssueNetUserID)" Password="$(IssueNetPassword)" QueryName="MyTaskQuery">
   7:              <Output TaskParameter="Results" ItemName="QueryResults" />
   8:          </ExecuteIssueNetQuery>
   9:   
  10:          <TransitionIssueNetTasks ConnectionName="$(IssueNetConnectionName)" UserID="$(IssueNetUserID)" Password="$(IssueNetPassword)" Objects="@(QueryResults)" TransitionName="Start" />
  11:      </Target>
  12:  </Project>

The following occurs in the execution of this file:

  • Line 1 is the standard outer Project tag for an MSBuild project file.
  • Lines 2 and 3 declare that we are using two tasks from the IssueNet library, ExecuteIssueNetQuery and TransitionIssueNetTasks.
  • Line 5 delimits the beginning of our target. This file only has one target. However, MSBuild allows multiple targets to be defined and selectively evaluated.
  • Line 6 executes a query named "MyTaskQuery" and Line 7 stores the results in an item "QueryResults".
  • Line 10 executes a transition "Start" on each task in "QueryResults".

We've even released a MSBuild HTTP Gateway for those adventurous enough to expose the functionality over the web.  If you have any questions, feel free to post them in the comments.


Related posts

Add comment


 

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

Tuesday, May 13, 2008 2:40 PM

Elsinore Company Blogs

Company blogs for Elsinore Technologies Inc.