Top Banner
TASKS AND WORKFLOW AUGUST 28, 2014 Photo Credit:
27

Magnolia CMS Tasks & Workflows

Nov 02, 2014

Download

Technology

Magnolia CMS

Learn how to create custom workflows for managing your editorial processes.This presentation covers Magnolia CMS process modelling and custom tasks, as well as how to implement a work item handler for executing custom tasks and configuring and putting the pieces together.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 1. TASKS AND WORKFLOW AUGUST 28, 2014 Photo Credit:
  • 2. ESPEN JERVIDALO SENIOR SOFTWARE ENGINEER
  • 3. AGENDA ! Introduction publication workflow Tasks Workflow process modelling
  • 4. MAGNOLIA 4.5 OpenWFE as workflow engine Work Item Inbox MAGNOLIA 4.5 OpenWFE as workflow engine Work Item Inbox OpenWFE discontinued ! OpenWFE discontinued
  • 5. WORKFLOW 5.0 - 5.2 jBPM 5 rudimentary integration incremental fixes
  • 6. WORKFLOW 5.3 bundled w/ Magnolia 5.2.x jBPM 6 rewritten persistence, configuration simplified
  • 7. NOTIFICATIONS Similar to emails Whats the status? Ooops I just deleted the message
  • 8. WORKFLOW 5.4 bundled w/ Magnolia 5.3 Introducing Tasks
  • 9. DEMO
  • 10. process jBPM engine publication workflow GOT IT? Call Activity processes Work Item Handler Human Task
  • 11. .
  • 12. TASKS AWESOME
  • 13. TASKS MODULE completely self contained CE Bundle
  • 14. DEMO
  • 15. Create a Task ! ! Task task = new Task(); ! // this maps to your task definition task.setName(yourTask); ! // relevant data for e.g. displaying in the Pulse. task.setContent(new HashMap() {{ .put(some, data) }}); ! // set actors task.setActorIds(susan, peter) ! tasksManager.addTask(task);
  • 16. Use TaskManger ! /** * Inject the TaskManager into your classes. */ @Inject public MyClass(TasksManager tasksManager) { this.taskManager = taskManager } !
  • 17. Email Notifications ! TaskEmailService implements TaskEventHandler { ! @Inject public(@Named(SystemEventBus.NAME) EventBus eventBus) { eventBus.addHandler(TaskEvent.class, this); } ! @Override public void taskResolved(TaskEvent taskEvent) { // send email code goes here } ! }
  • 18. THINK TASKS Can I do XY with workflow? We want to do XY with Workflow!
  • 19. Photo Credit: flying time by Luke Ma WORKFLOW
  • 20. PROCESS BASICS
  • 21. YOUR MODULE Your starting point Dont use Magnolias modules
  • 22. PROCESS Start with a simple process Learning by doing
  • 23. public class LogWorkItemHandler implements WorkItemHandler { ! private static final Logger log = LoggerFactory.getLogger(LogWorkItemHandler.class); ! @Override public void executeWorkItem(WorkItem workItem, WorkItemManager manager) { String parameter = (String) workItem.getParameter("whatever"); ! log.error(parameter); manager.completeWorkItem(workItem.getId(), new HashMap()); } Work ! @Override Item Handler public void abortWorkItem(WorkItem workItem, WorkItemManager manager) { ! } }
  • 24. THANK YOU!
  • 25. QUESTIONS?
  • 26. RESOURCES Magnolias Worflow documentation Including tutorial in the Academy http://documentation.magnolia-cms.com/display/DOCS/Workflow ! Official jBPM documentation ! Samples used in webinar available on Git: http://git.magnolia-cms.com/git/forge/jbpm-email-sample.git branch: webinar