Understanding the steps in DocumentObj Create method

Describes the different steps in DocumentObj Create method

The following flow describes the main steps and checks when creating a content object (logical, version and language).

  1. Validate all incoming parameters

    During this step the following checks are executed:
    • All required parameters are present
    • No system fields are supplied
    • All parameters contain a valid value.
    • In order to check this, the incoming language(s) are converted into a list with LovValue items.
  2. Initialize the folder (if provided)

    Validate the incoming folder upon existence and correctness of folder type

    Retrieve the folder security fields and temporary store the security fields

  3. Validate the incoming LogicalId

    • If no LogicalId is provided, a new LogicalId is generated using a new GUID
    • If a LogicalId is provided, check whether the logical object already exists or not
  4. Check that the user has write access to the folder or logical object
  5. Start transaction

    • If the logical object exists, the logical object is locked
  6. Initialize logical object (in memory)

    • If the logical object does not exist, create the logical object (in memory) . Copy the security fields from the folder
    • Otherwise, initialize all necessary metadata
  7. Initialize version object (in memory)

    • If the version object does not exist, create the version object (in memory)
    • Otherwise, initialize all necessary metadata
  8. Create the language object (in memory)

    • Check the initial status
    • Create the revision object and set the blob related fields
  9. Initialize the plugin engine

    • Find the Plugin Configuration Xml
    • Conditionally filter the Plugin Configuration Xml using the following conditions:
      ConditionNameCondition on...Example
      ISHType ISHMasterDoc, ISHModule, ISHLibrary, ISHIllustration, ISHTemplate
      FMAPIDThe unique identifier of the logical level (= LogicalId) 
      VERSIONThe version number1.1.1
      DOC-LANGUAGEThe languagefr
      FSOURCELANGUAGEThe source languageen
      FRESOLUTIONThe label of the resolutionLow
      EDTThe EDT specified on the output formatEDTXML
      ISHUserGroupThe element name of the usergroupVUSERGROUPSYSTEMMANAGEMENT
      CurrentActionThe current actionCreate
      ISHLevel

      The level

      logical, version, lng
    • Initialize the plugins
  10. Retrieve the metadata used by the plugins
  11. Run the plugins

    • All plugins are executed in order specified in the Plugin Configuration Xml
    • If the plugin fails, an ErrorRunningPlugin exception is thrown. This exception always wraps the exception which is thrown by the plugin itself.
  12. Check the initial status and set the status type
  13. Check that there are no multiple languages provided when submitting xml
  14. Update the information in the database:
    • Create all objects and set the new metadata
    • Link the version object with the logical object
    • Link the language object with the version object
    • Link the language with the new revision object
    • Stream the blob to the database
  15. When creating a new logical object...

    • Lock the parent folder
    • Retrieve the folder security fields, check that the values match the ones stored in the step 2
    • Link the logical object with the parent folder
  16. Start the background tasks from the plugins

  17. Commit the transaction