0
votes

I am trying to implement leave management module with Web Application using Activiti Workflow Engine, MySQL db and Spring Boot.

It basically includes apply for leave, assign to reporting manger, assign to hr if reporting manager does not respond in time, approve/reject leave etc etc.

I am beginner for activiti workflow. I am able to get basic concepts from this user-guide : http://www.activiti.org/userguide/ but I have couple of questions which I am not able to figure out from this documentation.

  1. General data : Should I need to use separate database for my business logic or should I need to add new tables into existing database which is being used by activiti itself?
  2. User data : I need to assign leaves to particular user and need to retrieve leaves assigned to particular user and also it should be role wise like hr, reporting-manager. I know identityService and taskService from activiti provides me the facility to Create User, Save User, Retrieve Tasks for particular user but my question is how can I map my application related User fields with activiti users? I can see couple of options to achieve this as given below, but not sure which is recommended and ideal.
    • Create new tables for User to achieve my business need and duplicate the data in Activiti related tables as well and map them using email-id.
    • Do not use Activiti related User tables at all and Add workflow related fields into my business related User table so that I can retrieve all things from one place. There will not be data duplication.
    • Do not create any extra new table related to User and Add extra fields into Activiti related User table as per my business need.

Please suggest the best approach from above and also suggest some directions how can I achieve the same? Thanks in advance.

1

1 Answers

0
votes
  1. General data : It is for sure better to have your own schema and database for your own application rather than mixing it up with the database of activiti. Different concerns, different deployment needs. Better to manage separately.
  2. User data : If your users are available via LDAP you can make activiti using that (http://www.activiti.org/userguide/#chapter_ldap). Otherwise all the options you listed seems to be bad options (somehow coupling your user model with activiti's user model or vice versa). In general I would not fiddle with Activiti schema and adding activiti related fields to your own model is also a bad idea. It is better to keep them separate and link/map them via an id or so. Of course I am writing a bit broadly here since I have no idea how your domain objects look like but I hope it helps...