Workflows - maksudsharif/Armedia-Training-Module GitHub Wiki

Workflows

If you haven't completed Jeff Pott's tutorial on Behaviors, read and complete that before following along here.

Jeff Potts explains it best:

Alfresco has two options for implementing workflows within the product. For very simplistic workflows, non-technical end-users can leverage Alfresco's Basic Workflow functionality. For more complex needs, Alfresco has Advanced Workflow functionality.

Basic Workflows

Basic workflows are a nice end-user tool. You should know how they work and what the features and limitations are so you can make good decisions about when to use them. Basic workflows use folders and a "forward step/backward step" model to implement serial processes. When a piece of content is dropped in a folder, a rule is triggered that associates a "forward step" and a "backward step" (one or the other or both) with the content. These steps are tied to Alfresco actions such as "Set a property" or "Move the content to a specified folder". End users can then click on the appropriate step for a given piece of content.

Advanced Workflows

Advanced workflows are useful when you need much more control over the business process. Typical requirements that require the use of the advanced workflow engine are things like:

Assignment of tasks to specific users or groups

  • Parallel paths through the business process
  • Decisions based on content metadata or other criteria
  • The ability to handle exceptions
  • Timers

All of these (and more) are features of the embedded Activiti workflow engine which is what is used to implement advanced workflows in Alfresco.

- source

If you have completed Jeff Potts' tutorial on Workflows, you should have the foundations down for how to implement a workflow. Though there are some helpful tips you should consider:

  • When possible, use the out-of-the-box workflow constructs in Alfresco instead of creating a new Workflow model.
  • Use bpm: namespace properties when working with properties associated with a workflow.
  • The JavaScript methods getTaskVariable and getTaskVariableLocal are to get workflow related variables while getExecutionVariable is for runtime variables that you create.

For the assignment, you will extend Jeff Potts' publishWhitepaper workflow to work with your own Type (or technicalReport if following the completed code).

Things to Know

Assignments

Extend publishWhitepaper workflow

For this you will need to create another workflow that is similar to publishWhitepaper, but it should:

  • Send reviews out to 3 user groups
  • Have confirmations from the initiator (of the workflow) to proceed at every logical step.
  • You can omit or keep the email third-party review portion of the workflows

Create a flagForReview workflow

For this you will need to make another workflow that is a notification and preliminary review for a submitted technicalReport. It should accomplish:

  • Send out a task to a "Coordinator" group that notifies them of a new submission
  • It should serve as a preliminary approve/reject for whether a formal review of the report should occur.
  • If approved it should ask for a confirmation to proceed from either the report author or the coordinator.
  • Set properties of the package contents to allow logic to start the formal review workflow created above.

Completed code with functionality is included which should help you.