DMS Operation Tutorial

The following tutorial describes how to use DMS operations to add, update and get a document.

Importing the Example Model

You can download and import the complete tutorial model DMS.xpdl. Download the following ZIP file containing the example model from here:

dms.zip

Perform the following steps to import the model:

  1. Create a dynamic Web project designed to deploy Stardust Process Platform models to run in the Stardust Portal. For detailed information on creating dynamic Web projects for usage with the Stardust Portal, please refer to the Rapid Application Development guide.
  2. Right-click your project and select Import > Process Manager > Process Model. Click Next and browse to the location of the example model extracted from the zip file.

Creating a Process to update a Document and create a new Version

In this example process we create a new document with a given name and description. We use the DMS operation Add Document, which creates the document and adds it to the repository. Per default, this operation creates a document without version. We use access point versioning and pass a true value to create a version for our new document. After that we update the document by using DMS operation Update Document. We change the name and description of the document and create a new version.

To prepare the model and process, perform the following steps:

  1. Create a dynamic Web project designed to deploy Stardust Process Platform models to run in the Stardust Portal.
    For detailed information on creating dynamic Web projects for usage with the Stardust Portal, please refer to the Rapid Application Development guide.
  2. Create a process definition called Update and Version Document and open its diagram

Continue by adding the workflow elements.

Creating the Applications

Create the following applications:

  1. Create a DMS Operation application and name it as DMS Operation Add Document

    DMS Operation
    Figure: DMS Operation Application

  2. Open the properties of the DMS Operation Add Document application
  3. Select DMS Operation in the left pane
  4. Select Add Document from the Operation drop-down list

    Properties
    Figure: Properties of DMS Operation Add Document

  5. Create another DMS operation application and name it as DMS Operation Update Document
  6. Open the properties of the DMS Operation Update Document application
  7. Select DMS Operation in the left pane
  8. Select Update Document from the Operation drop-down list

    Properties
    Figure: Properties of DMS Operation Update Document

Creating the Workflow

Create the following workflow:

  1. Start with a manual trigger
  2. Create an application activity Add Document and connect it to application DMS Operation Add Document
  3. Create a manual activity Enter new Document Name to enter a new name for the document
  4. Create an application activity Update Document to update the document name and description and create a new version. Connect it to application DMS Operation Update Document
  5. Create a manual activity Show Document to display the updated document

Creating the Data

Create the following data:

  1. Create a primitive data Initial Doc Name of type string and specify a document name, e.g. InitialDocName.txt in the Default Value field.
  2. Create a primitive data Initial Description of type string and add Initial content in the Default Value field.
  3. Create a primitive data New Doc Name of type string
  4. Create a primitive data New Doc Description of type string
  5. Create a primitive data Create Version of type boolean and select the Default Value check box
  6. Create a document data named Document

    Document Data
    Figure: Document Data

  7. Open the properties page of the document data
  8. Select DMS Document from the left pane and select default from the Declared Types

    Properties
    Figure: Properties of Document Data

Specifying the Data Mappings

Now we specify appropriate data mappings between each activity and data.

  1. Specify the following In-data mapping for the Add Document application activity:
    1. for the Initial Doc Name data:

      Properties
      Figure: In data mapping for Initial Doc Name

    2. for the Initial Description data:

      Properties
      Figure: In data mapping for Initial Description

    3. for the Initial Doc Name data:

      Properties
      Figure: In data mapping for versioning

  2. Specify the following out data mapping for application activity Add Document

    Properties
    Figure: Add Document - Out Data Mapping

  3. Add an in data mapping from the Document data to activity Enter new Document Name.
  4. Add an out data mapping from activity Enter new Document Name to data New Doc Name.
  5. Specify the following in-data mappings for the Update Document application activity:
    1. for the Document data:

      Properties
      Figure: In data mapping for Document

    2. for the New Doc Name data:

      Properties
      Figure: In data mapping for New Doc Name

    3. for versioning:

      Properties
      Figure: In data mapping for versioning

    4. for the New Doc Description data:

      Properties
      Figure: In data mapping for New Doc Description

  6. Specify the following Out-data mapping for the Update Document application activity

    Properties
    Figure: Update Document - Out Mapping

  7. Specify the following In-data mapping for the Show Document manual activity

    Properties
    Figure: In data mapping for

The following screenshot displays the complete process:

Process Diagram
Figure: Complete Process Diagram

Running the Example in the Process Portal

To run the example, perform the following steps:

  1. Start your server and deploy the model. For details on how to deploy a model, please refer to the chapter Deploying a Workflow Model of the Support Case Example.
  2. Start the Stardust Portal as described in chapter Logging in the Stardust Portal of the End User Handbook. Login as administrator (motu/motu). You can use the Shift-F8 short key.
  3. In the Workflow Execution perspective, start process Update and Version Document.

    Start Process
    Figure: Start Update and Version Document process

  4. Click the tab with the opened document InitialDocName.txt.

    Open Document
    Figure: Open created document

  5. Expand the Details section of the document properties. You see the initial description added to the created document.

    Document Details
    Figure: Document Details

  6. Close the document tab for InitialDocName.txt and enter a new name for the document in the manual activity.

    Enter new Document Name
    Figure: Enter new document name

  7. Complete the activity
  8. Activity Show Document is opened along with the renamed document. Click on the document icon to open the renamed document.

    Show Document
    Figure: Show Document

  9. Expand the Details section of the document properties. You see the description replaced with the new description.

    Updated Document
    Figure: Updated Document

  10. In the launch panel of the Workflow Execution perspective select Search Documents in the Documents section.

    Open Document Search View
    Figure: Click to open the Document Search View

  11. Enter a search pattern for the renamed document in the Document Name field and click Search.

    Search Document
    Figure: Click to search for document

  12. The renamed document gets displayed in the search result table. In the Actions column click the menu and select Version History

    Version History
    Figure: Version History

  13. The version history of the document gets displayed. We can see the initial document name and the changed versions in the table.

     History
    Figure: Version History of the Document

Creating a Process to get a Document by ID

In the following example process we add a document with a given document name, retrieve the document id via a message transformation and then use the Get Document DMS operation to retrieve the document via the given id.

Creating the Applications

Create the following applications:

  1. Add Document - a DMS application with operation Add Document

    Add Document DMS Operation
    Figure: Add Document DMS Operation

  2. Get Document - a DMS application with operation Get Document

    Get Document DMS Operation
    Figure: Get Document DMS Operation

  3. MTA Retrieve Doc ID - a simple message transformation application which retrieves a primitive data and maps it to an outgoing primitive data. This will be used to retrieve the document id of the created document and maps it to a primitive data.

    Message Transformation Properties
    Figure: Message Transformation Properties

Creating the Workflow

Create the following workflow:

  1. Start with a manual trigger
  2. Create a manual activity Enter Document Name to enter the name of the document to be created
  3. Create an application activity Add Document and connect it to application Add Document
  4. Create an application activity MTA Retrieve Document ID and connect it to application MTA Retrieve Doc ID
  5. Create a manual activity Show Document ID to display the retrieved document Id
  6. Create an application activity Get Document to retrieve the document by Id. Connect it to application Get Document
  7. Create a manual activity Show Document Name to display the retrieved document

Creating the Data

Create the following data:

  1. Create two primitive data DocumentName and DocumentID of type string
  2. Create two document data NewDocument and RetrievedDocument

Specifying the Data Mappings

Now we specify appropriate data mappings between each activity and data.

  1. Specify the following data mappings for the Add Document application activity:
  2. Specify the following data mappings for the MTA Retrieve Document ID application activity:
  3. Specify an in-data mapping from data Document ID to activity Show Document ID
  4. Specify the following data mappings for the Get Document application activity:
  5. Specify an in-data mapping from data RetrievedDocument to activity Show Document Name

The following screenshot displays the complete process:

Process Diagram
Figure: Complete Process Diagram

Running the Example in the Process Portal

To run the example, perform the following steps:

  1. Start your server and deploy the model
  2. Start the Stardust Portal as described in chapter Logging in the Stardust Portal of the End User Handbook. Login as administrator (motu/motu).
  3. In the Workflow Execution perspective, start the process Get Document Per ID

    Process
    Figure: Start DMS Operation Process

  4. Enter a document name for the new document and complete the activity.

    Enter document name
    Figure: Enter document name

  5. DMS application activity Add Document uses this data to create a document with the given name.
  6. Now the message transformation application maps the id of the new document to our primitive data Document ID.
  7. Activity Show Document ID opens to display the primitive data with the Id retrieved from the document.

    Show Document ID
    Figure: Activity showing retrieved document Id

  8. Complete the activity
  9. DMS application activity Get Document gets the document with this Id, which is the document we added.
  10. Activity Show Document Name opens and displays the name of the document with the given Id.

    Show Document
    Figure: Activity showing the document with the specific Id