Saturday, March 15, 2008

TPM SPB Import Automation Package

Posted by: martinc on Mar 06, 2008 - 04:07 PM

With TPM it is possible to import SPBs with the TCM integration, Software Package Editor or manually from the Web UI. I wanted to add another.

What happens if you have a bunch of SPBs that you want to import and you do not want to use the integration? Use the SPE or Web UI? That would take forever!

So I thought I would whip up a quick automation package to do just that. Click here to download the automation package.

The package is made up of 3 workflows

GBS_FindAllSpb.wkf
Function: Retrieves a list of all SPBs based on the FileRepository rootPath and the RelSearchPath

Arguments:

  • FileRepositoryID - This is the ID of the file repository to use for the search. Yes this could be changed to the name if you want.
  • RelSearchPath - This would be the path to search relative to the FileRepository.
    For example:
    if you enter "/" (no quotes) this will search the rootPath of the file repository and all sub-directories for spb files
    if you enter "/ActivePerl" (no quotes) this will search the rootPath of the file repository and all sub-directories under ActivePerl for spb files

    Calls: GBS_GetSpbVariables.wkf

    GBS_GetSpbVariables.wkf
    Function: Retrieves various package attributes used to define the Software Module to TPM.

    Arguments:
  • SpbRelPath - This is the relative path to the SPB found in GBS_FindAllSpb.
  • SpbFileName - The file name to retrieve the package attributes from.
  • FileRepositoryID - This is the ID of the file repository to use for root path

    Calls: GBS_ImportSPB.wkf

    GBS_ImportSPB.wkf
    Funtion: Using the variables passed in from GBS_GetSpbVariables.wkf, creates a XML file in the same directory as the SPB and then uses the built-in workflow called DcmXmlImport to import the XML file.

    Arguments:
  • SpName - value retrieved from the field Name in the SPB
  • SpVersion - value retrieved from the field Version in the SPB
  • SpVariables - value(s) retrieved from the default_variables field in the SPB
  • SpbRelPath - This is the relative path to the SPB
  • SpbFileName - File name of the SPB
  • FileRepositoryID - This is the ID of the file repository to use for root path

    Extra Notes

    It is also possible to just run GBS_GetSpbVariables.wkf if there is only one SPB to define. Just pass the required fields into the workflow execution and only that SPB will be defined

    With this template, it is very easy to make some changes that would suit your environment. Any comments or feedback is appriciated.

    Martin Carnegie
  • 3 comments:

    briank said...

    I found your automation package while looking for a solution to migrate our TCM packages.

    I did get an error running the GBS_GetSpbVariables wf on my tpm svr.

    Any chance at looking at the error message for insight?

    briank said...

    Hi Martin,

    I found your automation package while looking for a solution to migrate our TCM packages.

    I did get an error running the GBS_GetSpbVariables wf on my tpm svr.

    Any chance at looking at the error message for insight?

    Martin Carnegie said...

    I can take a look. Please email anything to martin dot carnegie at gulfsoft dot com