ENHANCED WORKFLOWS IN    CASCADE SERVER       LEAH EINECKER
WORKFLOWS AT PCCWe love workflow!Pages edited by subject matter expertsContent must be approved by administratorresponsibl...
NIFTY FEATURE: WORKFLOW REPORTCreated from index block and formatThis came with the system install
WORKFLOW INDEX
NIFTY FEATURE #2: APPROVER EDITS• What if the approver wants to make a simple change to a page?• The page is locked, so th...
APPROVER EDITS<action identifier="approver-edits" label="Send to myself  for edits" next-id="approver-edits" move="next_id...
NIFTY FEATURE #3: ESCALATIONS• Escalations - If a workflow is ignored for a set period  of time, automatically send it to ...
ESCALATION DETAILS
CUSTOM FEATURE: WORKFLOW EMAILS• Our users go through a lot of workflows• Notfication email needs more information than th...
SAMPLE EMAILS
CUSTOM WORKFLOW TRIGGERSCreate a new class:public class EmailProvider2 extendscom.cms.workflow.function.EmailProviderWe pu...
WRITING A CUSTOM TRIGGERCalling any trigger executes:public boolean process() throwsTriggerProviderException, FatalTrigger...
ADD TRIGGER TO WORKFLOW             DEFINITION• Triggers are defined in the <triggers> section of  each workflow definitio...
CUSTOM TRIGGER IN WORKFLOW          DEFINITION<trigger name="email" >  <parameter>           <name>mode</name>     <value>...
DEFINING EMAIL MESSAGES• Messages are defined in a Java properties file  • Could just as well have been text, XML, etc…• U...
SAMPLE EMAIL DEFINITIONSemail.needs-approval.mailApproversOnly = 1email.needs-approval.subj = Web page needs approval - [W...
CUSTOM FEATURE: ESCALATIONS• What if you know an approver is on vacation, and  you dont want to wait for the escalation ti...
ON DEMAND ESCALATIONS
ESCALATION TOOL UI• Written in JSP• Placed in:• [cascade install]/tomcat/webapps/ROOT/pccCustom/wkflow• Access at:• https:...
ACCESS CONTROLLoginInformationBean login =  (LoginInformationBean)session.getAttribute("user");if  (!ServiceProviderHolder...
SEARCHING WORKFLOWS FOR USERResults powered bycom.hannonhill.cascade.model.service.WorkflowServiceMust fetch both active a...
HAVE WORKFLOW, WILL ESCALATEWorkflowService has method to escalate all overdueworkflows, but no method to escalate just on...
AND NOW, A WORD ABOUT HIBERNATE• By default, Hibernate uses lazy collection fetching• If an object has an associated colle...
SO WE HAVE TO MESS WITH HIBERNATE?• We could alter the Hibernate configuration XML files  • Set lazy="false" on chosen pro...
OR…• Generate additional DB queries for properties as  needed  • How often will you manually escalate a workflow?• No perf...
USING JOINS• Bean getters get lazily-initialized objects  • workflow.getCurrentStep()  • workflowStep.getEscalationStep() ...
EXCEPT…The Hibernate DAO for workflow steps does notexpose a way to join properties.package edu.pima.cascade.model.dao.hib...
ADD NEW BEAN TO CASCADE• Spring looks for configuration files in the classpath:  • com.hannonhill.cascade.config.spring.ap...
FINALLY: ESCALATE THE WORKFLOW• Since we are forcing early escalation, reset the  "normal" escalation timeout  escalateSte...
QUESTIONS? THANK YOU         Leah Einecker   Pima Community College     leinecker@pima.edu
Upcoming SlideShare
Loading in …5
×

Enhanced Workflows in Cascade Server by Leah Einecker

1,000 views

Published on

Pima Community College makes extensive use of workflows and has made some enhancements to the Cascade Server workflow system. This presentation will cover:

-Types of workflow used
-Interesting applications of stock Cascade Server workflow features
-New feature: customizing the email messages that are generated by workflows
-New feature: allowing the webmaster to manually escalate a neglected workflow

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,000
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Enhanced Workflows in Cascade Server by Leah Einecker

  1. 1. ENHANCED WORKFLOWS IN CASCADE SERVER LEAH EINECKER
  2. 2. WORKFLOWS AT PCCWe love workflow!Pages edited by subject matter expertsContent must be approved by administratorresponsible for content areaNobody gets publish permissions -- all publishing doneby workflow
  3. 3. NIFTY FEATURE: WORKFLOW REPORTCreated from index block and formatThis came with the system install
  4. 4. WORKFLOW INDEX
  5. 5. NIFTY FEATURE #2: APPROVER EDITS• What if the approver wants to make a simple change to a page?• The page is locked, so they can only send it to another step in the workflow• Dont want to generate emails to any other user or have the chance that another user will jump on the file• With the right trigger, you can send a workflow exclusively to yourself
  6. 6. APPROVER EDITS<action identifier="approver-edits" label="Send to myself for edits" next-id="approver-edits" move="next_id"> <trigger name="com.cms.workflow.function.preserveCurrentUser"/></action>
  7. 7. NIFTY FEATURE #3: ESCALATIONS• Escalations - If a workflow is ignored for a set period of time, automatically send it to the webmaster• This is not the same as the due-date / end-date on a workflow<step type="transition" identifier="review"label="Approver review" default-group="Administrators"escalate-to="escalate" escalation-hours="336">
  8. 8. ESCALATION DETAILS
  9. 9. CUSTOM FEATURE: WORKFLOW EMAILS• Our users go through a lot of workflows• Notfication email needs more information than that a workflow "needs attention" • Need to re-edit one I submitted? • Approve one sent by someone else?• Not very helpful to say that a workflow has ended • Do I really have to log into CMS just to see if it was approved or rejected?
  10. 10. SAMPLE EMAILS
  11. 11. CUSTOM WORKFLOW TRIGGERSCreate a new class:public class EmailProvider2 extendscom.cms.workflow.function.EmailProviderWe put this class in a JAR file that contains all ourcustom Java (pccCustom.jar)Put new JAR in:[cascade home]/tomcat/webapps/ROOT/WEB-INF/lib/
  12. 12. WRITING A CUSTOM TRIGGERCalling any trigger executes:public boolean process() throwsTriggerProviderException, FatalTriggerProviderExceptionOverride the process() method, while allowing mosteverything else to be inherited from superclassUseful variables available inside process() method:com.hannonhill.cascade.model.workflow.adapter.PublicWorkflowAdapter workflowcom.hannonhill.commons.util.string.StringMap parametersString mode = parameters.get("mode");
  13. 13. ADD TRIGGER TO WORKFLOW DEFINITION• Triggers are defined in the <triggers> section of each workflow definition• Cannot be added in GUI workflow builder, must edit XML<!-- default trigger --><trigger class="com.cms.workflow.function.EmailProvider"name="EmailProvider"/><!-- custom trigger --><trigger name="email"class="edu.pima.cascade.workflow.EmailProvider2" />
  14. 14. CUSTOM TRIGGER IN WORKFLOW DEFINITION<trigger name="email" > <parameter> <name>mode</name> <value>was-approved</value> </parameter></trigger>
  15. 15. DEFINING EMAIL MESSAGES• Messages are defined in a Java properties file • Could just as well have been text, XML, etc…• Use placeholders for common fields like workflow name and generating HTML links to the CMS• Depending on workflow step type, emails are targeted to workflow owner (submitter) or the group owning the asset • Messages about approval being required go to the group owning the asset, but limited to the Approval role
  16. 16. SAMPLE EMAIL DEFINITIONSemail.needs-approval.mailApproversOnly = 1email.needs-approval.subj = Web page needs approval - [WORKFLOW_NAME]email.needs-approval.msg = <p>A web page or document is waiting for your review and approval - [WORKFLOW_NAME]</p> <p>Use the link below to access the web workflow:<br /> <a href="[VIEW_WORKFLOW_URL]">View the workflow screen</a></p>email.was-approved.subj = Web page was approved - [WORKFLOW_NAME]email.was-approved.msg = <p>A web page or document that you submitted to CMS workflow has been approved - [WORKFLOW_NAME]</p> <p>Use the link below to view the document in the web content management system:<br /> <a href="[VIEW_ASSET_URL]">View document</a></p>
  17. 17. CUSTOM FEATURE: ESCALATIONS• What if you know an approver is on vacation, and you dont want to wait for the escalation timeout?• Want to be able to find and "steal" their workflows• The webmaster should be able to take any workflow at any time!
  18. 18. ON DEMAND ESCALATIONS
  19. 19. ESCALATION TOOL UI• Written in JSP• Placed in:• [cascade install]/tomcat/webapps/ROOT/pccCustom/wkflow• Access at:• https://your.cms/pccCustom/wkflow• Putting custom components in separate directory for safety during upgrades
  20. 20. ACCESS CONTROLLoginInformationBean login = (LoginInformationBean)session.getAttribute("user");if (!ServiceProviderHolderBean.getServiceProvider().getRole Service().userHasRoleByRolename(login.getUsername(), "Administrator")){ errMsg = "Only administrators can do that!";}
  21. 21. SEARCHING WORKFLOWS FOR USERResults powered bycom.hannonhill.cascade.model.service.WorkflowServiceMust fetch both active and waiting workflows for userList<Workflow> wkflows =wkflowService.getActiveWorkflowsForUser(username);wkflows.addAll(wkflowService.getWaitingWorkflowsForUser( username));
  22. 22. HAVE WORKFLOW, WILL ESCALATEWorkflowService has method to escalate all overdueworkflows, but no method to escalate just oneWe will have to do the escalation ourselves! Find current step of the Find workflow escalation step of Advance current step workflow to the escalation step
  23. 23. AND NOW, A WORD ABOUT HIBERNATE• By default, Hibernate uses lazy collection fetching• If an object has an associated collection, the collection is retrieved from DB only when it is specifically requested• If property is "many-to-one" in Hibernate XML config, it is affected unless we override lazy fetching• The current step of a workflow is many-to-one• As is the escalation step of a workflow step
  24. 24. SO WE HAVE TO MESS WITH HIBERNATE?• We could alter the Hibernate configuration XML files • Set lazy="false" on chosen properties• But this affects every workflow/step load in the system• And is likely to be overwritten in an upgrade• But its easy to do
  25. 25. OR…• Generate additional DB queries for properties as needed • How often will you manually escalate a workflow?• No performance hit to system in general• No modifications to existing CMS components• This is more complicated to do!
  26. 26. USING JOINS• Bean getters get lazily-initialized objects • workflow.getCurrentStep() • workflowStep.getEscalationStep() • By default both of these will yield LazyInitializationException!• We can request objects with additional properties joined from most DAOs • HashSet<Join> joins = new HashSet<Join>(); joins.add(new Join(Workflow.PROPERTY_CURRENT_STEP)); workflow = workflowDao.get(workflowId, joins); step = workflow.getCurrentStep(); // success!
  27. 27. EXCEPT…The Hibernate DAO for workflow steps does notexpose a way to join properties.package edu.pima.cascade.model.dao.hibernate;public class HibernateWorkflowStepDAO extendscom.hannonhill.cascade.model.dao.hibernate.HibernateWorkflowStepDAO implements WorkflowStepDAO { /*************************************************** * Parent class assumes you would not want to join * wkflow steps. This is probably just an oversight. */ public WorkflowStep get(String id, Set<Join> joins) { //fetch() is a protected method on BaseHibernateDAO. return ((WorkflowStep)fetch(id, WorkflowStep.class, joins)); } }
  28. 28. ADD NEW BEAN TO CASCADE• Spring looks for configuration files in the classpath: • com.hannonhill.cascade.config.spring.applicationContext*.xml• Add a new configuration file • applicationContextPcc.xml • Not overwritten when upgrading Cascade Server • Want to remove all the custom components? Just remove the XML config file from the classpath<bean id="pccWorkflowStepDAO" class="edu.pima.cascade.model.dao.hibernate.HibernateWorkflowStepDAO"/>
  29. 29. FINALLY: ESCALATE THE WORKFLOW• Since we are forcing early escalation, reset the "normal" escalation timeout escalateStep.setStartedOn(Long.valueOf(System.currentTi meMillis()));• Do the actual escalation workflow.setCurrentStep(escalateStep); workflowService.save(workflow); workflowMgmtService.advanceWorkflow(workflow.getId(), "system", null, "Workflow escalation forced by administrator");
  30. 30. QUESTIONS? THANK YOU Leah Einecker Pima Community College leinecker@pima.edu

×