Getting Started

1- Creating the Expense Document Type

This document is part of the Sub-Workflow Example project series.

What Will We Do in This Step?

We will create the document type on which the workflow will be launched.

Reviewing the Rules

Before starting the document type creation, we will take a little time to review what is expected from us at this step:

  • Users should be able to fill in their expenses and attach the corresponding receipt.
    => This means we need to create a document type that will allow us to attach a binary file. The file will be a mandatory field.

  • Each expense should be validated separately.
    => No more than one binary file at a time then.

  • Expense type can be chosen from a list (transportation, hotel or misc).
    => We will need to create a vocabulary.

  • Expenses worth 100 dollars or more and/or belonging to the misc type have to be validated by the accounting service and the general manager, otherwise only by the accounting service.
    => The user will have to fill the amount; amount and expense type should be mandatory fields.

Alright; now that we know where we are heading to, we can look further.

Creating the Vocabulary

Before creating the document type, we will create the vocabulary so that we have all necessary elements to complete it afterwards.

  1. In Nuxeo studio, go to Vocabularies and click on the New button.
  2. Name your vocabulary: expenseType.
  3. Leave the default vocabulary type, a simple vocabulary is exactly what we need.
  4. Add the following entries into the vocabulary (leave the default values for elements not indicated in the table):

  5. Save your vocabulary. You can take a look at the expected result below:

Creating the Expense Document Type

On to the document type creation.

  1. In Nuxeo Studio, go to Content Model > Document Types, and click on the New button.
  2. Fill in the fields:

    • Feature ID: Expense
    • Extends: Choose "Nothing"
    • Label: Expense
  3. Click on the Ok button.

Defining the Document Type

Now that the document type is created, we have to define its specificities.

Definition Tab

  1. Set the category to Document.
  2. (Optional) You may add icons if you like to, your document type will be nicer that way.
  3. Save your modifications. Look at the result below:

Schema Tab

We will need to add two specific fields: amount and type.

  1. In the Add extra schemas to this document type section, add the file schema (not files). Our document will now be able to hold a single binary file.
  2. In the Add a custom schema section:
    • Add a field named amount of type Floating point.
    • Add a field named expensetype of type Directory and select the expenseType directory created above.
  3. Save your modifications.

Defining the Document Type Layouts

  1. Click on Configure Layouts in Designer to go to Designer.
  2. On the Create layout, click on Configure and create the layout as following:
  3. Go back to the Expense layout and at the bottom of the table, click on Configure Missing Layout
  4. Save your modifications.

Our document type is ready to rock!

a month ago GitHub Fix release date on deprecated addons
3 years ago Manon Lumeau 14 | ix Studio menu label
4 years ago Manon Lumeau 13
4 years ago Solen Guitter 12 | Update Schema tab step
5 years ago Manon Lumeau 11
5 years ago Manon Lumeau 10
5 years ago Manon Lumeau 9 | formatting
5 years ago Solen Guitter 8 | Fixed broken links
6 years ago Solen Guitter 7
6 years ago Solen Guitter 6 | Fixed formatting and typos
6 years ago Bertrand Chauvin 5
6 years ago Bertrand Chauvin 4
6 years ago Bertrand Chauvin 2
6 years ago Bertrand Chauvin 3
6 years ago Bertrand Chauvin 1
History: Created by Bertrand Chauvin

We'd love to hear your thoughts!

All fields required