Skip to Content
avatar image
Former Member

Configuration and check out

Hi,

is there a possibility, to setup the Configuration in such way, the Models are not opened automatically during a checkout of the Configuration?

We have the problem, there are 11 models, who are dependent in term of Target Models. It’s not possible to do it using the sequence in the Configuration as almost all models have links to other Models.

What I can do, is to uncheck the “Open document” option, but this I have to do for each Model in the Configuration each time I want to check it out.

Is there a way to set it permanently or a way to uncheck this option for all Models in the Configuration?

BR,

Rafal

check-out.jpg (59.3 kB)
configuration.jpg (65.0 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Dec 14, 2017 at 06:51 PM

    You need write code to call function

    CheckOutToFile

    Note the third argument setting, by default, is true. You need change to false.

    CheckOutToFile(ByVal Filename As String, ByVal MergeMode As Long = 2, ByVal OpenMode As Boolean = True, ByRef Actions As String = Nothing, ByRef Conflicts As String = Nothing) As BaseObject
    Checks out a repository document into a local file. In case of existence of the file, the check out will fail if it is read only and in other case it will try to merge the two documents (for models or multi model reports only). If the filename is an empty string, the document will be checked out in memory only. The merge mode specified as second parameter can contains the following values:
    0 will check out the document without merge, erasing the existing local document if any, and will set the file as read-only.
    1 will check out the document without merge, erasing the existing local document if any.
    2 is the default and will try to automatically select the default merge actions taking into account the modification dates of objects and will cancel the check out if a conflict has been found (objects modified both in local and the repository).
    3 will also select default merge actions but it will always favor local changes in case of conflict instead of canceling the check out.
    4 will select default merge actions and will favor the repository changes in case of conflict.
    The merge action performed during the check out and the conflicts found can be retrieved in the strings specified in the last parameters.The third parameter specified if we need to keep opened the model.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Philip,

      thanks for your swift reply. Due to the Holidays I was only able to test this now.

      Unfortunately the second argument of the CheckOutToFile function in our PD (16.6 SP01 PL01) is not "merge" but "merge mode". In the metamodel objects help it is described as followed, which were also the results I found when I tested this - None of it resulted in merge dialogue:

      CheckOutToFile(ByVal Filename As String, ByVal MergeMode As Long = 2, ByVal OpenMode As Boolean = True, ByRef Actions As String = Nothing, ByRef Conflicts As String = Nothing) As BaseObject

      (...) merge mode specified as second parameter can contains the following values:
      0 will check out the document without merge, erasing the existing local document if any, and will set the file as read-only.
      1 will check out the document without merge, erasing the existing local document if any.
      2 is the default and will try to automatically select the default merge actions taking into account the modification dates of objects and will cancel the check out if a conflict has been found (objects modified both in local and the repository).
      3 will also select default merge actions but it will always favor local changes in case of conflict instead of canceling the check out.
      4 will select default merge actions and will favor the repository changes in case of conflict.
  • Jan 08 at 09:31 PM

    If you want merge dialog to show up, you need check out the model first. then open the model you want to merge with.

    Then call merge function. Note you need set InteractiveMode to I'm_Dialog ( see document for detail)

    Example:

    Assume you have already checked out a pdm model called AA.pdm. And you have a second model called BB.pdm in your local drive.

    set AA = openModel("C:\AA.pdm")

    set BB = openModel("C:\BB.pdm")

    InteractiveMode=im_Dialog
    AA.merge BB

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 09 at 04:28 PM

    Hi Phillip,

    unfortunately the merge function is not solving our problem of being able to check out models in a configuration without openening them in order to not disturb the target models. This is why we wanted to use the function CheckOutToFile and use the Parameter "Open Model" to ensure the models are checked out and not opened in the workspace.

    Ideally we would be able to open a merge dialogue in case one of the models has already been checked out to the same location. Unfortunately this is not possible and opening the models to merge them is not an option as this would result in an Target Model Error.

    Nevertheless the function "CheckOutToFile" is a helpful hint - thanks!

    Add comment
    10|10000 characters needed characters exceeded