"2 activities have the exact same order" - does it mean activities in the same workflow or different workflows?
Activities in the same workflow
What does the activity ordering to do with ordering of applicationContext files in patchConfigLocations in web.xml?
Setting up workflows is done in different applicationContext.xml files and the workflow definitions are merged together. The way that you tell Broadleaf that you have multiple applicationContext.xml files is in the patchConfigLocations parameter in web.xml.
So say that you have 2 applicationContext.xml files: appCtx1.xml, appCtx2.xml. They are declared in patchConfigLocations like so:
Code: Select all
<context-param>
<param-name>patchConfigLocation</param-name>
<param-value>
classpath:/appCtx1.xml
classpath:/appCtx2.xml
</param-value>
</context-param>
In appCtx1.xml I have this:
Code: Select all
<bean id="blCheckoutWorkflow" class="org.broadleafcommerce.core.workflow.SequenceProcessor">
<property name="activities">
<list>
<bean p:order="6000" class="com.mycompany.core.workflow.Activity1" />
</list>
</property>
</bean>
And then in appCtx2.xml I have this:
Code: Select all
<bean id="blCheckoutWorkflow" class="org.broadleafcommerce.core.workflow.SequenceProcessor">
<property name="activities">
<list>
<bean p:order="6000" class="com.mycompany.core.workflow.Activity2" />
</list>
</property>
</bean>
Both of these activities have the same ordering, but appCtx2.xml appears after appCtx1.xml in patchConfigLocation. These beans get merged together and the final configuration that I have is:
Code: Select all
<bean id="blCheckoutWorkflow" class="org.broadleafcommerce.core.workflow.SequenceProcessor">
<property name="activities">
<list>
<bean p:order="6000" class="com.mycompany.core.workflow.Activity1" />
<bean p:order="6000" class="com.mycompany.core.workflow.Activity2" />
</list>
</property>
</bean>
Thus, Activity2 will be executed
after Activity1.
This really only comes into play when you add other modules (like from
http://www.broadleafcommerce.com/docs/c ... nt/modules) that make modifications to workflows. Then you might have 2 modules that add activities to the same workflow and also have the same activity ordering. In that case, the ordering in which you put the applicationContext.xml files for those modules can come into play.
Ideally an activity ordering should be an integer which is at least 1 less than the immediately earlier activity ordering and at least one more than the immediately next activity ordering - is this right?
Think of the activity ordering as a sort. The activities that have a lower number will occur prior to activities with a higher number.