Question

I am working in a multi-user environment with models shared using CVS.

The model is large with lots of packages. Sometimes, I have a package checked out without realising it, preventing others from working with the package.

Is there some way I can list all the packages that I have checked out so that I can check in the ones I don't need?

Was it helpful?

Solution

Enterprise Architect has a built-in query which exactly meets your needs:

  1. Open the "Find in Project" window by Ctrl+F. A search window will be displayed.

  2. On the top you will see a "search:" dropdown list which by default is set to "Simple".

  3. Choose the last option from drop down list: "My Checked-out Packages".

  4. Press the "Run" button or F5 to get the list.

OTHER TIPS

As @Uffe pointed out, I've created a JScript to solve the problem:

!INC Local Scripts.EAConstants-JScript

/*
 * Script Name: ListingCheckOutPackages
 * Author: Stepanus David Kurniawan
 * Purpose: List all packages which are checked out by this user or other user recursively
 * Date: 05-05-2014
 */

// CheckOutStatus
var csUncontrolled = 0;
var csCheckedIn = 1;
var csCheckedOutToThisUser = 2;
var csReadOnlyVersion = 3;
var csCheckedOutToAnotherUser = 4;
var csOfflineCheckedIn = 5;
var csCheckedOutOfflineByUser = 6;
var csCheckedOutOfflineByOther = 7;
var csDeleted = 8;

/*
 * Project Browser Script main function
 */
function OnProjectBrowserScript()
{
    Repository.EnsureOutputVisible( "Script" );
    Repository.ClearOutput( "Script" );

    // Get the type of element selected in the Project Browser
    var treeSelectedType = Repository.GetTreeSelectedItemType();

    switch ( treeSelectedType )
    {
        case otPackage :
        {
            // Code for when a package is selected
            var thePackage as EA.Package;
            thePackage = Repository.GetTreeSelectedObject();

            Session.Output("----------------------------------------");
            Session.Output("... listing check out packages under " + thePackage.Name + "...");

            GetSubpackage(thePackage);

            Session.Output("----------------------------------------");

            break;
        }

        default:
        {
            // Error message
            Session.Prompt( "This script does not support items of this type.", promptOK );
        }
    }
}

var depth = 0;

function GetSubpackage( thePackage )
{
    var contextPackage as EA.Package;
    contextPackage = thePackage;

    depth++;

    // Iterate through all child packages
    for (var i = 0 ; i < contextPackage.Packages.Count; i++)
    {
        var currentPackage as EA.Package;
        currentPackage = contextPackage.Packages.GetAt(i);

        //Session.Output(new Array(depth * 4 + 1).join(' ') + currentPackage.Name + currentPackage.VersionControlGetStatus());

        switch (currentPackage.VersionControlGetStatus())
        {
            case csCheckedOutToThisUser:
                Session.Output("[Checked out to this user ] " + currentPackage.XMLPath);
                break;
            case csCheckedOutToAnotherUser:
                Session.Output("[Checked out to other user] " + currentPackage.XMLPath);
                break;
        }


        // Recursively process child packages
        GetSubpackage( currentPackage );
    }

    depth--;
}

OnProjectBrowserScript();

To my knowledge there is (in EA 10) no GUI dialog that shows you this information. What you can do is write an in-EA script of the Project Browser type to perform this check. Such a script would traverse a package hierarchy and, for each, call Package::VersionControlGetStatus().

Check the help file under Automation and Scripting -- Enterprise Architect Object Model -- Reference. The Package class is in the Repository package, and there are code samples which show you how to traverse the hierarchy.

For EA 12 as states the best answer is applicable next additional steps:

  1. in the first combo set "Project status" default is "Common Searches"
  2. in the second combo will be selected "My Checked Out Packages" by default

You can also list your locks under

Project->Security->Manage My Locks...

if you are using lock based access control.

For EA 13.5 is possible to use build-in option: Menu Configure -> Sub menu Manage -> Manage my locks

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top