2 Replies Latest reply on Feb 1, 2014 9:52 AM by Maciej Swiderski

    Decision subprocess vs. custom workitem

    Jan Stastny Newbie


      while designing my processes I came across a situation where I have to decide, whether I'd use reusable subprocess, or custom workitem definition with its handler.


      I have similar structure of classes to this one: City is spread on many Tiles that have many Properties. I need to aggregate the Property values for given city before I can make a decision, what should be executed next within the process.

      Two ways of doing that have come on my mind. First - create subprocess probably only with Script Tasks as its items and process the logic via gateways.

      Second I'd make a workitem definition and I would process the logic in its handler.

      I read somewhere, that in processes there should be only description of WHAT we want to achieve, not HOW.

      Moreover in workitem handler there should be only procedure which describes HOW single thing is to be done.


      Could you advise me, which solution is better, or if there's another one?

      I personally tend to choose the one with custom work item definition and its handler.


      Looking forward to your suggestions


        • 1. Re: Decision subprocess vs. custom workitem
          Mauricio Salatino Master

          Hi Jan,

          Both approaches are possible as you mention. You should ask yourself if showing the processing of the cities and the properties needs to be shared with non technical users, or if this logic will change over the time. If that's not the case the WorkItemhandler will be the option to follow. Most of the time hiding technical details is the best option to keep the process simple and clear for the non technical users. This will improve the maintainace of your process and your code.



          1 of 1 people found this helpful
          • 2. Re: Decision subprocess vs. custom workitem
            Maciej Swiderski Master

            just to add on top of what Mauricio said, maybe use of business rules might come in handy here as well. So the entire logic that is responsible for deciding what should happen can be defined as set of rules.



            1 of 1 people found this helpful