Author Topic: Are the Rules getting too complicated ?  (Read 25301 times)

JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Are the Rules getting too complicated ?
« on: August 01, 2013, 10:38:22 am »
Looking at the features of V3 to V2, I (and this is my opinion) think the Rules are getting too hard to setup to use features like Ticket/Order States.

What I mean is maybe we need to look at the Rules themselves and make them more flexible and remove some of the guess work.

1. It is hard to know exactly what variables are available to each rule, so maybe add a legend (like Printer Templates) showing what information can be retrieved when using the selected Rule.
2. Instead of having fixed Constraints, have a drop down list of variables to select from. Have an 'Add' button to add more constraints
3. Expand the expression list from =, !=, ?, etc to also include other common expressions like
 - Starts With
 - Ends With
 - Is Length

Ticket and Order States needs to be more readily available within Rules as especially Ticket States can remove the need to use some {:Settings} variables and eliminates the issues with retaining Ticket/Customer data when closing and re-opening tickets later, like Customer Discounts on specific items.
SambaPOS - POS'n the World, one Terminal at a time.

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Are the Rules getting too complicated ?
« Reply #1 on: August 01, 2013, 12:30:06 pm »
I completely agree! I'm about to release 3.0.17 so our base theme for 3.0.18 can be refactoring automation. I'll focus on this.

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Are the Rules getting too complicated ?
« Reply #2 on: August 21, 2013, 08:16:37 am »
First step of improvement is supporting printer template tags inside rules so instead of using expressions we can read ticket or order data with printer template tags. I hope it will simplify things because we are familiar with them. This feature is done!

Second step will be adding custom constraint lines for building expressions like {TICKET TAG:Blah} = ABC. It will work like current rule parameters but as you suggested we can type values in left part and we'll be able to type template tags :) I think that will improve rules a lot.

Stelzi79

  • Newbie
  • *
  • Posts: 19
    • My mercural-fork on Bitbucket
Re: Are the Rules getting too complicated ?
« Reply #3 on: August 21, 2013, 08:35:27 am »
The real problem is the lack of documentation and the multiple steps to implement a feture with Rules, AutomatiationCommands and Actions. If you need also setup up Account- or Warehouse-Transaction it gets even more complicated and undocumented. For example to fully implement a sane Tax-handling you need to do 5 additions or settings in different areas of Settings and without setting Account-Transaction doesn't even begin to work which isn't realy clear in the beginning.

 I've an idea to implement and Template/Wizzard type of system where you only configure some smal details and the wizzard configures the rest and points you to additional setting you may have to do. Such a Template/Wizzard-System would make it realy easy to use all the powerfullness of SambaPOS.
My changes to the official version:
MY mercurial fork on bitbucket

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Are the Rules getting too complicated ?
« Reply #4 on: August 21, 2013, 04:41:27 pm »
Yes I agree and I'm aware of the situation. Especially it is hard for V2 users.

Our real power is the simplicity. V3 is not easy to configure yet but simple. Once you get the idea it gives a lot of possibilities. We have a lot of small pieces that needs to be connected to build something. Before adding a feature I'm thinking twice (even more) if it can be done by using current features. If so I don't add additional features. That creates an abstraction and this is the reason of the complex configuration.

Look how I removed payment buttons and used automation commands instead. Ironically instead of writing code I've deleted code to implement the request and the reason of that change was the settle button. As you know we are using portrait mode for handheld devices and one of our users asked to disable settle button on tablets. Uh? In fact it can be solved easily by adding a simple setting to disable settle button but I know this is only the tip of the iceberg. They'll want settle button for managers or some people just don't want it at all. This is already possible with automation commands because of the wide mapping features so instead of adding that simple setting I've deleted whole code and switched it to commands. As a result of that code removal we gained bonus features. For example we can disable settle button for specific ticket states to implement proper workflow. Of course some users complained because of this change because creating a fast payment button was a single click. Now it needs a lot of configuration. I know it....

It can be easier with tooling as you suggested. What we need to do is just auto generating required data.

We used similar idea for menus or other areas at "Batch Create XYZ" screens. For example a "Batch Create Tax" tool can create required account templates, accounts and transaction templates from entered Tax Configuration lines. Instead of wizards I thought tooling should be text based so it can be shared. We are using this text file idea for generating default menus and tables on installation. That just needs improvement. At the end we can have a single text file for whole configuration. Even for rules, actions etc.. This is what called as DSL. You can read more about the idea here http://www.primaryobjects.com/CMS/Article127.aspx

However my current priority is the infrastructure. When I add features for ease of use before finishing the infrastructure I have to delete it later so that creates waste. Before implementing hammer I have to be sure nail works fine.

I hope we can have little more development, financial and social power to implement all ideas quickly, generate documentation and of course influence people. I don't like having undocumented code, undocumented features and a lot of missing other things too. When I first started SambaPOS I decided to give priority to "requests". We have thousands of installs but for me real SambaPOS user count is not more than 20. I thought if I can solve their problems I can solve everybody's problems. As a result three years of community interaction brought us here. I don't know yet if it was a bad idea or not but I believe we're still on the right track.

Sorry for the long post. I thought I have to explain my thoughts so we can create better solutions. Thank you for reading it.
« Last Edit: August 21, 2013, 04:45:18 pm by emre »

JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: Are the Rules getting too complicated ?
« Reply #5 on: August 21, 2013, 05:38:28 pm »
For me, the hardest part is knowing what variables can be used with each rule.
Using Printer Template Tags as a base for variables is a great idea.

And we definitely need an easy way to read Ticket Tags and Ticket States, so we don't need to track info already available with Update Program Settings.

We are putting together manuals for SambaPOS, but some things like promotions are hard to document because there can be so many variants, and honestly, most of my customers would rather pay me to configure the backend for them.
SambaPOS - POS'n the World, one Terminal at a time.

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Are the Rules getting too complicated ?
« Reply #6 on: August 21, 2013, 06:06:37 pm »
John no problem I can create documentation and as more people gets features they'll contribute. However we need to reach final state to prevent double work. For example as we implement tooling like Wolfgang suggested documentation should change.

Ticket Tags and Ticket States can be read by printer template tags like {TICKET TAG:Blah}. When I bring it to final state you'll see it will be even easier than we thought (V2) :)

Note: I prefer to write documentation because while writing it I notice a lot of issues and fix them. This is something like a test.
« Last Edit: August 21, 2013, 06:10:05 pm by emre »

JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: Are the Rules getting too complicated ?
« Reply #7 on: August 21, 2013, 06:40:45 pm »
Note: I prefer to write documentation because while writing it I notice a lot of issues and fix them. This is something like a test.
For the backend, like Rules, Accounts, etc you will not get any arguments from me :) And I am the same with documentation.

We are putting together manuals for end users to cover day to day activities. These processes will hardly change.
SambaPOS - POS'n the World, one Terminal at a time.

JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: Are the Rules getting too complicated ?
« Reply #8 on: August 21, 2013, 06:57:24 pm »
I understand the issue with documentation. As SambaPOS keeps evolving, any current documentation runs the risk of being outdated. And this really is not a bad thing. All it means is that SambaPOS is reaching new levels of potential and features.

My lecturers used to complain that when we had a programming assignment, I would start coding first. They kept saying that I needed to do a high level design first. My reply was, that would be double work as the end result would be different to the original concept and half way through I would find better ways of doing something.
In the end they gave up because I always got 80% or higher marks and more often then not I had more interesting solutions to the problems.
SambaPOS - POS'n the World, one Terminal at a time.

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Are the Rules getting too complicated ?
« Reply #9 on: August 22, 2013, 04:36:51 pm »
I think in ancient times (!) most software development ideas taken from civil engineering :) We should thank to Kent Beck (and other special people) for agile software development idea.

emre

  • SambaPOS Developer
  • Samba Team
  • Hero Member
  • *****
  • Posts: 1564
Re: Are the Rules getting too complicated ?
« Reply #10 on: August 27, 2013, 07:50:14 pm »
Hello. Finally I've managed to implement my idea. https://github.com/emreeren/SambaPOS-3/releases/tag/V3.0.25-Beta

Feel free to share your thoughts about it.

JohnS

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 677
Re: Are the Rules getting too complicated ?
« Reply #11 on: August 27, 2013, 08:00:57 pm »
Can't wait to test :)

I have another idea for an Action to go with this.
A Question Action. For example, if a rule triggers for a promotion, you can ask "Would you like this promotion? Yes/No" if yes, then execute rule, if no then terminate rule.

This can be used to promote 2 for 1, or buy 1 get second at 50% off, etc.
SambaPOS - POS'n the World, one Terminal at a time.