Custom Workflow Sample

All files of the workflow are published to Github. Here we will tell about the stages of this workflow, how to build it, and install it to Alfresco.

image

Workflow consist of the five stages:

  1. Initiator of the workflow assigns a task to review a contract draft to a number of users. Also initiator attaches a file (or files) to the task and fill a field “Contractor” by selecting a name of the contractor from a list of predefined values (master data connected as JSON file).

    image

    image

  2. Reviewers read the document. At the time of review a document is locked, so reviewers cannot edit files while the task is not completed by all reviewers. They can download file, edit it and upload as another document, or write their comments in the field “Comments”.

    image

  3. If at least one reviewer rejects a document, initiator receives a task to revise it. Initiator sees all comments and files. He can edit a document and send it to the reviewers again.

    image

  4. If all reviewers approved a document, then initiator receives a notice that review is completed. He selects a site with document register in which the document will be registered. When user clicks “Register” button, document is automatically added to the selected register, system assign ID to a document, fill the field “Registration Date”, “Contractor”, “Signatory” (assignee of the next task), attach all files from the task.

    image

    image

  5. The next task called “Sign a document” is sent to the user who has the role “CEO” in the org chart. This task includes some “offline” work. Person can download, print, sign documents or you can integrate Alfresco with some Digital Signature solution. After the work is done user completes the task. At this moment the status of the document in the register is changing to “Signed” and the field “Date of signing” is filled with the current date.

    image

    image

Prerequisites:

  • Alfresco 4.2.4 / 4.2.f with installed Alvex Enterprise 2.1.3 on top of it. Alvex should be installed as AMP (not JAR).
  • Org Chart should be created in Admin Console or using API. Create a role “CEO” and attach it to the top branch of the org chart. Select a user who has this role.
  • Site with created document register to store contracts (type: alvexdt:agreement). User with “CEO” role and initiator of the workflow should have RW permissions to the register.
  • Attach external master data source to Alvex and name it “Contractors”. For example, you can use http://www.alvexsoftware.com/files/sample.json. Attach master data to the document register.

    image

Build

  1. Download workflow sources from Github.
  2. To see the workflow scheme and to build a package, import them to Eclipse as two projects: Tutorial Workflow Repo (tutorial-workflow-repo folder) and Tutorial Workflow Share (tutorial-workflow-share folder).
  3. To build a project create configuration in Eclipse:
    1. Click Run -> Run Configurations, then select Maven and click New launch configuration.
    2. Enter name and base catalog of the project Tutorial Workflow Repo. As a goal use package.
    3. Save configuration. Click Run.
    4. In the same way create a configuration for Tutorial Workflow Share project.

    image

  4. Run created configurations to build projects.
  5. Install amp packages from target folders to Alfresco. Do not forget to allow users to start new workflow (use “Workflow Permissions” tab in Admin Console for it.

Another option is to build projects without Eclipse. Go to tutorial-workflow-repo folder and use “mvn package” command. Repeat for tutorial-workflow-share.

blog comments powered by Disqus