Process State vs. Object State Workflow Modeling Best Practices ASUG Webcast, April 7th, 2010 Thorsten Franz
Agenda Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion Busine...
Agenda Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion Busine...
Introduction <ul><li>High impact of good and bad workflow design decisions </li></ul><ul><li>Frequently  affected by chang...
Making design decisions that last <ul><li>Strive for… </li></ul><ul><li>Maintainability </li></ul><ul><ul><li>Simplicity <...
Agenda Business Processes and Objects Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-o...
Business Processes and Business Objects <ul><li>Process knowledge </li></ul><ul><li>Starting conditions </li></ul><ul><li>...
Business Processes and Business Objects <ul><li>Object knowledge </li></ul><ul><li>Object attributes and methods </li></ul...
Agenda Business Processes and Objects Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-o...
Anti-Patterns in Workflow Modeling <ul><li>Anti-Pattern 1: Business Object bloated with process knowledge </li></ul><ul><l...
Example: Two simple (healthy) status graphs for objects * New Submitted In Process Approved Rejected Discarded approve acc...
Anti-Patterns in Workflow Modeling <ul><li>Anti-Pattern 1: Object bloated with process knowledge (cont‘d) </li></ul><ul><l...
Anti-Patterns in Workflow Modeling <ul><li>Anti-Pattern 1: Object bloated with process knowledge (cont‘d) </li></ul><ul><l...
Anti-Patterns in Workflow Modeling <ul><li>Problem: Object is not process-independent </li></ul><ul><li>Overloaded with de...
Anti-Patterns in Workflow Modeling <ul><li>Everything is in the process </li></ul><ul><li>Object itself is stateless – sta...
Anti-Patterns in Workflow Modeling <ul><li>Cramped workflow containers  lead to „binding hell“. </li></ul><ul><li>Dozens o...
Business Processes and Business Objects <ul><li>Problem: Overly complex workflow is hard to maintain </li></ul><ul><li>Non...
Agenda Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion Busine...
Cutting Through Complexity <ul><li>„ Separation of concerns“ </li></ul><ul><li>Separating process aspects from object aspe...
Cutting Through Complexity <ul><li>Recommendations for object modeling </li></ul><ul><li>Draw a complete status diagram fo...
Agenda Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion Busine...
Optimizing Reusability <ul><li>Design Business Objects for Reuse </li></ul><ul><li>Provide simple access to CRUD methods <...
Agenda Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion Busine...
Hands-on Coding Tips <ul><li>Consider using the Object Services framework </li></ul><ul><li>Easy-to-use framework for obje...
Hands-on Coding Tips <ul><li>Methods of interface IF_WORKFLOW </li></ul>
Hands-on Coding Tips <ul><li>Event creation </li></ul><ul><li>METHOD raise_created. </li></ul><ul><li>DATA:  lv_objkey TYP...
Agenda Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion Busine...
Conclusion <ul><li>1. Making the right cuts is essential </li></ul><ul><li>In complicated business scenarios, complexity i...
Questions & Answers
Thank you very much… <ul><li>…  for your attention! </li></ul>
Upcoming SlideShare
Loading in …5
×

Process State vs. Object State: Modeling Best Practices for Simple Workflows and Reusable Business Objects

2,582 views

Published on

Modeling Best Practices for Simple Workflows and Reusable Business Objects.

Making the right design decisions when modeling your BusinessObjects helps keeping your workflows simple and ensures optimal reusability and stability of your BusinessObjects. In this Webcast, we will discuss some criteria and best practices for what goes into the BusinessObjects and what goes into the process model.

Speaker: Thorsten Franz, AOK Systems

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

No Downloads
Views
Total views
2,582
On SlideShare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
0
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Process State vs. Object State: Modeling Best Practices for Simple Workflows and Reusable Business Objects

  1. 1. Process State vs. Object State Workflow Modeling Best Practices ASUG Webcast, April 7th, 2010 Thorsten Franz
  2. 2. Agenda Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion Business Processes and Objects
  3. 3. Agenda Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion Business Processes and Objects
  4. 4. Introduction <ul><li>High impact of good and bad workflow design decisions </li></ul><ul><li>Frequently affected by changes </li></ul><ul><ul><li>at detail level </li></ul></ul><ul><ul><li>at process level </li></ul></ul><ul><ul><li>in the organization </li></ul></ul><ul><li>Usability important for occasional users </li></ul><ul><li>Question of reusability posed frequently </li></ul><ul><li>Maintainability is crucial </li></ul><ul><ul><li>adapting to changes </li></ul></ul><ul><ul><li>repairing errors </li></ul></ul>
  5. 5. Making design decisions that last <ul><li>Strive for… </li></ul><ul><li>Maintainability </li></ul><ul><ul><li>Simplicity </li></ul></ul><ul><ul><li>Adaptability </li></ul></ul><ul><ul><li>„ Repairability“ </li></ul></ul><ul><li>Reusability of components </li></ul><ul><li>Optimal balance between Process and Objects </li></ul>
  6. 6. Agenda Business Processes and Objects Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion
  7. 7. Business Processes and Business Objects <ul><li>Process knowledge </li></ul><ul><li>Starting conditions </li></ul><ul><li>Sequence of steps – what happens when? </li></ul><ul><li>Dependencies between steps </li></ul><ul><li>Agent determination </li></ul><ul><li>Current process state </li></ul><ul><li>Workflow container </li></ul>
  8. 8. Business Processes and Business Objects <ul><li>Object knowledge </li></ul><ul><li>Object attributes and methods </li></ul><ul><li>When is the object internally consistent? </li></ul><ul><li>Possible object states </li></ul><ul><li>Which methods invoke state changes </li></ul><ul><li>Checks and restrictions for state changes </li></ul><ul><li>Current object state </li></ul>
  9. 9. Agenda Business Processes and Objects Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion
  10. 10. Anti-Patterns in Workflow Modeling <ul><li>Anti-Pattern 1: Business Object bloated with process knowledge </li></ul><ul><li>Organizational details such as two-man rule encoded in business object </li></ul><ul><li>Methods pose too many preconditions </li></ul><ul><ul><li>agent who executes them </li></ul></ul><ul><ul><li>state of other objects </li></ul></ul><ul><ul><li>process state </li></ul></ul><ul><ul><li>previous steps </li></ul></ul><ul><li>Methods pose too many postconditions </li></ul><ul><ul><li>start workflows </li></ul></ul><ul><ul><li>dialog steps </li></ul></ul><ul><li>Object status graph encodes process knowledge </li></ul>
  11. 11. Example: Two simple (healthy) status graphs for objects * New Submitted In Process Approved Rejected Discarded approve accept submit check discard (re-)submit <ul><li>Thought experiments: </li></ul><ul><li>1) Incorporate Two-man rule </li></ul><ul><li>Level A approved </li></ul><ul><li>Level B approved </li></ul><ul><li>Level A rejected </li></ul><ul><li>Level B rejected </li></ul><ul><li>2) Incorporate channel dependency </li></ul><ul><li>Manually submitted </li></ul><ul><li>Submitted through website </li></ul><ul><li>3) Incorporate follow-up steps </li></ul><ul><li>Material ordered </li></ul><ul><li>Material out of stock </li></ul>Unchecked Valid Processed Invalid update update process Discarded discard
  12. 12. Anti-Patterns in Workflow Modeling <ul><li>Anti-Pattern 1: Object bloated with process knowledge (cont‘d) </li></ul><ul><li>Problem: Process state disguised as object state </li></ul><ul><li>New statuses drive graph complexity </li></ul><ul><li>Number of edges grows quicker than number of nodes </li></ul><ul><li>Increased complexity in method implementations (precondition checks) </li></ul>
  13. 13. Anti-Patterns in Workflow Modeling <ul><li>Anti-Pattern 1: Object bloated with process knowledge (cont‘d) </li></ul><ul><li>Contains process-specific methods </li></ul><ul><li>Contains methods that really belong in a helper class </li></ul><ul><ul><li>not „something you can do to the object“ </li></ul></ul><ul><ul><li>static methods (sometimes) </li></ul></ul><ul><ul><li>methods that do refer to the object </li></ul></ul><ul><li>Cause side effects </li></ul><ul><ul><li>print letters </li></ul></ul><ul><ul><li>initiate other processes and workflows </li></ul></ul>
  14. 14. Anti-Patterns in Workflow Modeling <ul><li>Problem: Object is not process-independent </li></ul><ul><li>Overloaded with dead freight </li></ul><ul><li>No reuse in different processes </li></ul><ul><li>or… </li></ul><ul><li>Wrong reuse in unrelated processes due to helper methods </li></ul><ul><li>Increased cross-dependencies </li></ul>
  15. 15. Anti-Patterns in Workflow Modeling <ul><li>Everything is in the process </li></ul><ul><li>Object itself is stateless – state is tracked in workflow container </li></ul><ul><li>Consistency rules for object are implemented in the workflow </li></ul><ul><ul><li>complicated conditions evaluating workflow container </li></ul></ul><ul><ul><li>identical checks repeated throughout the workflow pattern </li></ul></ul>Anti-Pattern 2: Process without a Business Object: „Nobject“
  16. 16. Anti-Patterns in Workflow Modeling <ul><li>Cramped workflow containers lead to „binding hell“. </li></ul><ul><li>Dozens of parameters going into and out of each workflow step make workflows impossible to maintain. </li></ul><ul><li>The same could be achieved by passing one object reference from the workflow container. </li></ul>Anti-Pattern 2: Process without a Business Object: „Nobject“ (cont‘d)
  17. 17. Business Processes and Business Objects <ul><li>Problem: Overly complex workflow is hard to maintain </li></ul><ul><li>None of the object‘s internal complexity is separated from the inherent process complexity </li></ul><ul><li>Problems not broken down – hard to solve </li></ul><ul><li>Problem: No reuse of Business Object in other processes </li></ul><ul><li>„ Move along, there‘s nothing to reuse here“ </li></ul><ul><li>Huge redundancies between similar workflows </li></ul><ul><li>Change of internal object behaviour requires changing many workflows </li></ul>
  18. 18. Agenda Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion Business Processes and Objects
  19. 19. Cutting Through Complexity <ul><li>„ Separation of concerns“ </li></ul><ul><li>Separating process aspects from object aspects </li></ul><ul><li>Modularizing for reuse </li></ul><ul><li>Reducing complexity – each sub-problem is simpler than the whole </li></ul>Software design is about breaking down problems
  20. 20. Cutting Through Complexity <ul><li>Recommendations for object modeling </li></ul><ul><li>Draw a complete status diagram for your business object </li></ul><ul><li>Reduce complexity as much as possible </li></ul><ul><li>Identify and eliminate process state disguised as object state </li></ul><ul><li>Example: It‘s suspicious when object states describe </li></ul><ul><ul><li>what somebody is currently doing or </li></ul></ul><ul><ul><li>what should happen next </li></ul></ul><ul><li>Imagine completely different processes (which may be out of scope for your current project). </li></ul><ul><li>Does your object model hold? </li></ul>
  21. 21. Agenda Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion Business Processes and Objects
  22. 22. Optimizing Reusability <ul><li>Design Business Objects for Reuse </li></ul><ul><li>Provide simple access to CRUD methods </li></ul><ul><ul><li>Create </li></ul></ul><ul><ul><li>Read </li></ul></ul><ul><li>Reduce pre- and postconditions („extra luggage“) </li></ul><ul><ul><li>application state </li></ul></ul><ul><ul><li>database state </li></ul></ul><ul><ul><li>workflows and processes </li></ul></ul><ul><li>Use loose coupling techniques extensively </li></ul><ul><ul><li>Event coupling – SAP Business Workflow uses it (tcode SWETYPV ) </li></ul></ul><ul><ul><li>Raise events instead of starting processes directly </li></ul></ul><ul><ul><li>Write your own event handlers </li></ul></ul><ul><ul><li>Update </li></ul></ul><ul><ul><li>Delete </li></ul></ul><ul><ul><li>… and FindBy* </li></ul></ul>
  23. 23. Agenda Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion Business Processes and Objects
  24. 24. Hands-on Coding Tips <ul><li>Consider using the Object Services framework </li></ul><ul><li>Easy-to-use framework for object-relational persistence in ABAP Objects </li></ul><ul><li>Generates complete classes and handler classes for database tables </li></ul><ul><li>Stay away from BOR generated persistence </li></ul><ul><li>Use Interface IF_WORKFLOW instead of BOR objects </li></ul><ul><li>SAP Workflow doesn‘t require Business Object Repository anymore </li></ul><ul><li>State-of-the-art coding techniques now available </li></ul><ul><li>Implement interface IF_WORKFLOW in any class to use it with SAP Business Workflow </li></ul><ul><li>http://help.sap.com/saphelp_nw70/helpdata/de/cd/0fe6c5b143db4d8c806b9b346f9a43/frameset.htm </li></ul>
  25. 25. Hands-on Coding Tips <ul><li>Methods of interface IF_WORKFLOW </li></ul>
  26. 26. Hands-on Coding Tips <ul><li>Event creation </li></ul><ul><li>METHOD raise_created. </li></ul><ul><li>DATA:  lv_objkey TYPE sibflpor-instid. </li></ul><ul><li>lv_objkey = mr_angebot->get_id( ). </li></ul><ul><li>TRY. </li></ul><ul><li>cl_swf_evt_event=>raise_in_update_task( im_objcateg = 'CL' </li></ul><ul><li>im_objtype  = 'ZCL_ANGEBOT_WS' </li></ul><ul><li>im_event    = 'CREATED'                                          im_objkey   = lv_objkey ). CATCH cx_swf_evt_invalid_event       cx_swf_evt_invalid_objtype.   MESSAGE 'Event creation failed' TYPE 'E'. </li></ul><ul><li>ENDTRY. </li></ul><ul><li>ENDMETHOD. </li></ul>
  27. 27. Agenda Anti-Patterns Introduction Cutting Through Complexity Optimizing Reusability Hands-on Coding Tips Conclusion Business Processes and Objects
  28. 28. Conclusion <ul><li>1. Making the right cuts is essential </li></ul><ul><li>In complicated business scenarios, complexity is not going to go away </li></ul><ul><li>But you can break it down into smaller, much more manageable chunks </li></ul><ul><li>Find the best cutting line to separate process knowledge from object knowledge </li></ul><ul><li>2. Do not overload your Business Objects </li></ul><ul><li>Keep them lean for reuse in many different processes and scenarios </li></ul><ul><li>Try to anticipate future uses but do not limit your objects to those </li></ul><ul><li>3. Use state-of-the-art technology </li></ul><ul><li>IF_WORKFLOW , Object Services, Event Type Linkages ( SWETYPV ) </li></ul>
  29. 29. Questions & Answers
  30. 30. Thank you very much… <ul><li>… for your attention! </li></ul>

×