ilog.rules.teamserver.model

Interface ActivityLockingFacility

  • All Known Subinterfaces:
    IlrSession


    public interface ActivityLockingFacility
    Provides change activity locking facilities. A new activity lock is created when an element is edited in a change activity. This prevents editing the same element in another change activity until the lock is released. These methods expect the working baseline to be a release or a change activity.
    • Method Detail

      • unlockActivityElements

        void unlockActivityElements(IlrRelease release)
                                    throws IlrApplicationException
        Should be called when an activity is closed. This will release (delete) all activity locks within a given release for which there is no longer justifying activities.
        Throws:
        IlrApplicationException
        Parameters:
        release - The release.
      • ownsActivityLock

        boolean ownsActivityLock(IlrElementHandle element)
                                 throws IlrApplicationException,
                                        ilog.rules.teamserver.model.IlrAPIException
        Returns true if the working branch is a change activity that owns an activity lock on a given element.
        Throws:
        IlrApplicationException
        ilog.rules.teamserver.model.IlrAPIException - if the element is not a project element.
        Parameters:
        element - The element.
        Returns:
        true if the working branch is a change activity that owns an activity lock on a given element.
      • ownsActivityLock

        boolean ownsActivityLock(IlrActivity activity,
                               IlrElementHandle element)
                                 throws IlrApplicationException,
                                        ilog.rules.teamserver.model.IlrAPIException
        Returns true if the given activity owns an activity lock on a given element.
        Throws:
        IlrApplicationException
        ilog.rules.teamserver.model.IlrAPIException - if the element is not a project element.
        Parameters:
        activity - The activity to be checked for whether it is the owner of an activity lock for this element.
        element - The element.
        Returns:
        true if the working branch is a change activity that owns an activity lock on a given element.
      • isActivityElementBusy

        boolean isActivityElementBusy(IlrElementHandle element)
                                      throws IlrApplicationException,
                                             ilog.rules.teamserver.model.IlrAPIException
        Returns true if the working branch is a change activity and there is an activity lock set on this element by a different change activity.
        Throws:
        IlrApplicationException
        ilog.rules.teamserver.model.IlrAPIException - if the element is not a project element.
        Parameters:
        element - The element.
        Returns:
        true if the working branch is a change activity and there is an activity lock set on this element by a different change activity.
      • isActivityElementBusy

        boolean isActivityElementBusy(IlrManagedBranch cmgBranch,
                                    IlrElementHandle element)
                                      throws IlrApplicationException,
                                             ilog.rules.teamserver.model.IlrAPIException
        Returns true if there is an activity lock set on this element by a different change activity.
        Throws:
        IlrApplicationException
        ilog.rules.teamserver.model.IlrAPIException - if the element is not a project element.
        Parameters:
        cmgBranch - The branch for which we need to check if the element is busy.
        element - The element.
        Returns:
        true if cmgBranch is a change activity and there is an activity lock set on this element by a different change activity.
      • getActivityLockOwner

        java.lang.String getActivityLockOwner(IlrElementHandle element)
                                              throws IlrApplicationException
        Returns the name of the change activity that owns this element lock.
        Throws:
        IlrApplicationException
        Parameters:
        element - The element.
        Returns:
        the name of the change activity that owns this element lock.
      • getActivityLockOwner

        java.lang.String getActivityLockOwner(IlrActivity activity,
                                            IlrElementHandle element)
                                              throws IlrApplicationException
        Returns the name of the change activity that owns this element lock.
        Throws:
        IlrApplicationException
        Parameters:
        activity - The activity in which the query will be run. The owner will be a brother activity of this one.
        element - The element.
        Returns:
        the name of the change activity that owns this element lock.
      • eltNameLockVisible

        IlrActivityLock eltNameLockVisible(IlrActivity act,
                                         IlrElementDetails eltDtls)
                                           throws IlrApplicationException
        Returns an activity lock valid in the context of a given change activity for the same element fully qualified name. If no element lock can be found with the same element fully qualified name (same name in same package), or if this lock is not valid in the context of this change activity (this change activity is created after this lock is justified), then the returned value is null.
        Throws:
        IlrApplicationException
        Parameters:
        act - The change activity.
        eltDtls - The element details.
        Returns:
        the activity lock associated to this change activity for this element if any.
      • releaseActivityLock

        void releaseActivityLock(IlrElementHandle element)
                                 throws IlrApplicationException
        Deletes the activity lock set on a given element, even if there are still justifying activities for this element in the release. This may cause conflicts later on, when trying to close those justifying activities.
        Throws:
        IlrApplicationException
        Parameters:
        element - The element.
      • releaseActivityLock

        void releaseActivityLock(IlrManagedBranch cmgBranch,
                               IlrElementHandle element)
                                 throws IlrApplicationException
        Deletes the activity lock set on a given element, even if there are still justifying activities for this element in the release. This may cause conflicts later on, when trying to close those justifying activities.
        Throws:
        IlrApplicationException
        Parameters:
        cmgBranch - The managed branch in which the lock to delete is defined.
        element - The element.
      • isTakeOwnershipAvailable

        boolean isTakeOwnershipAvailable(IlrElementHandle element)
                                         throws IlrApplicationException
        Checks if an activity-lock is already allocated for this element and if the working baseline may become the new owner of this lock. The working branch has to be an activity which becomes the new owner of the activity lock. The new owner should be in the same release as the previous owner. Also, the activity element should be busy for this new owner.
        Throws:
        IlrApplicationException
        Parameters:
        element - The element for which we need to check if activity lock ownership can be acquired.
        Returns:
        true if take activity lock ownership is possible on given element for current activity.
      • isTakeOwnershipAvailable

        boolean isTakeOwnershipAvailable(IlrActivity newOwner,
                                       IlrElementHandle element)
                                         throws IlrApplicationException
        Checks if an activity-lock is already allocated for this element and if the given activity may become the new owner of this lock. The new owner should be in the same release as the previous owner. Also, the activity element should be busy for this new owner.
        Throws:
        IlrApplicationException
        Parameters:
        newOwner - The activity to be checked for whether it may become the new owner of the activity-lock allocated for this element.
        element - The element to be checked for whether activity lock ownership can be acquired.
        Returns:
        true if take activity lock ownership is possible on the given element for the current activity.
      • takeOwnership

        boolean takeOwnership(IlrElementHandle element)
                              throws IlrApplicationException
        Takes ownership of a justified activity lock already allocated for the given element. The conditions checked by isTakeOwnershipAvailable() must be true for this action to apply. When the operation is applied, the element details are merged to the working branch so that it gets the latest details of this element.
        Throws:
        IlrApplicationException
        Parameters:
        element - The element for which the activity lock owner should get changed.
        Returns:
        true if the operation is successful.
      • takeOwnership

        boolean takeOwnership(IlrActivity newOwner,
                            IlrElementHandle element)
                              throws IlrApplicationException
        Takes ownership of a justified activity lock already allocated for the given element. The conditions checked by isTakeOwnershipAvailable() must be true for this action to apply. When the operation is applied, the element details are merged to the given activity. so that it gets the latest details of this element.
        Throws:
        IlrApplicationException
        Parameters:
        newOwner - The activity that should become the new owner of the activity-lock for this element.
        element - The element for which the activity lock owner should get changed.
        Returns:
        true if the operation is successful.

© Copyright IBM Corp. 1987, 2015