cancel
Showing results for 
Search instead for 
Did you mean: 

splitting persistence into modules

tombaeyens
Champ in-the-making
Champ in-the-making
as a side track of http://jira.codehaus.org/browse/ACT-540 (Distill db name from the datasource), I split up the persistence modules.  create, drop and update of tables is done per component.  The 4 components are
* engine
* history
* identity
* cycle

In the ProcessEngineConfigurationImpl, those 4 components can be turned on or off:

  protected boolean isDbEngineUsed = true;
  protected boolean isDbIdentityUsed = true;
  protected boolean isDbHistoryUsed = true;
  protected boolean isDbCycleUsed = false;

But spontaneously it looks a bit wired to create all tables in the engine, than the two modules get really tightly coupled. What is the motivation?


The dependency basically remains the same: a library dependency.

The only thing we have have to revisit is how you build your service.  you have to create a ProcessEngineConfiguration.  You could create a CycleConfiguration and then inherit from ProcessEngineConfiguration or have a ProcessEngineconfiguration member field depending on which config items you want to expose.

In various refactorings I have bumped into the cycle specific persistence behaviour.  Also in the QA/CI scripts.  This needs to be unified for consistency and ability to manage it.

I have taken into account your feature request that it should be possible to create and work only with the Cycle tables.   This can be achieved by setting isDbCycleUsed to true and the other 3 booleans to false.  This could be done e.g. in a CycleConfiguration as described above.

OK?
4 REPLIES 4

meyerd
Champ on-the-rise
Champ on-the-rise
Hi tom,

Thx for the pointers.  I will get back to you about the conceptional stuff later.
ATM I am still struggling with the build. Smiley Happy

Currently looking at distro/src/setup/build.xml  Line 209

should it be changed to
      <javaresource name="org/activiti/db/create/activiti.${db}.create.engine.sql"
                    classpathref="classpath.libs" />

?

(same thing in line 222)

Regards,
daniel

meyerd
Champ on-the-rise
Champ on-the-rise
Hi Tom,

could you please have a look at http://fisheye.codehaus.org/changelog/activiti/?cs=2035 ?

Is this how you intended it?

I also noticed that you took out the isDbEngineUsed field in your last commit. Is it coming back ? Smiley Happy

Regards,
daniel

meyerd
Champ on-the-rise
Champ on-the-rise
Maybe "org.activiti.engine.impl.db.DbManagementSession" needs to be revised now, specifically the field


protected static String[] tableNames = new String[]{
    "ACT_GE_PROPERTY",
    "ACT_GE_BYTEARRAY",
    "ACT_RE_DEPLOYMENT",
    "ACT_RU_EXECUTION",
    "ACT_ID_GROUP",
    "ACT_ID_MEMBERSHIP",
    "ACT_ID_USER",
    "ACT_RU_JOB",
    "ACT_RE_PROCDEF",
    "ACT_RU_TASK",
    "ACT_RU_IDENTITYLINK",
    "ACT_RU_VARIABLE",
    "ACT_HI_PROCINST",
    "ACT_HI_ACTINST",
    "ACT_HI_TASKINST",
    "ACT_HI_DETAIL"
  };

Daniel

tombaeyens
Champ in-the-making
Champ in-the-making
sorry for the late response.  only now trying to catch up with forums. 

i reviewed the cycle code.  you're now building a process engine and then taking the pieces that you need.  that is exactly how it should be.  great work!

i also refactored the scripts you mentioned and the tableNames now also are obtained through metadata.