Documentation Home

2.2 to 2.3 Migration

Workflows

Full, updated documentation on workflows is located at Workflows and Activities. This has actually made your custom configuration much simpler, as you no longer need to redeclare the entire Broadleaf workflow just to add a single activity. Instead, simply change the ordering of your activity.

For instance, you might have overridden the blAddItemWorkflow to execute some sort of analytics. You might find something like this in your applicationContext:

<bean id="blAddItemWorkflow" class="org.broadleafcommerce.core.workflow.SequenceProcessor">
    <property name="processContextFactory">
        <bean class="org.broadleafcommerce.core.order.service.workflow.CartOperationProcessContextFactory"/>
    </property>
    <property name="activities">
        <list>
            <bean class="org.broadleafcommerce.core.order.service.workflow.add.ValidateAddRequestActivity"/>

            <!-- Custom activity for analytics -->
            <bean class="com.mycompany.core.workflow.AddToAnalyticsActivity"/>

            <bean class="org.broadleafcommerce.core.order.service.workflow.add.AddOrderItemActivity"/>
            <bean class="org.broadleafcommerce.core.order.service.workflow.add.AddFulfillmentGroupItemActivity"/>
            <bean class="org.broadleafcommerce.core.order.service.workflow.PriceOrderIfNecessaryActivity"/>
            <bean class="org.broadleafcommerce.core.order.service.workflow.VerifyFulfillmentGroupItemsActivity"/>
        </list>
    </property>
    <property name="defaultErrorHandler" ref="blDefaultErrorHandler"/>
</bean>

Since these lists are now merged, if you were to start up the application you would get duplicates of the framework activities, all ordered at the end of the workflow. In the new way to configure workflows, the above definition would simplify to:

<bean id="blAddItemWorkflow" class="org.broadleafcommerce.core.workflow.SequenceProcessor">
   <property name="activities">
        <list>           
            <!-- Custom activity for analytics -->
            <!-- Explicitly specify the ordering to occur between the first and second activity -->
            <bean p:order="1500" class="com.mycompany.core.workflow.AddToAnalyticsActivity"/>
        </list>
    </property>
</bean>

*Important Note:* don't forget to specify orderings for your activities if they need to occur in-between framework activities. If you do not explicitly specify an order, your activity will be placed at the end of the workflow (more explicitly, the default order is Ordered.LOWEST_PRECEDENCE).

Database Changes

You can find the history of changes to the database in the [[Database-Model]].

You can run the following script AT YOUR OWN RISK to update your tables.

alter table BLC_ADDRESS add column PHONE_FAX_ID bigint;
alter table BLC_ADDRESS add column PHONE_PRIMARY_ID bigint;
alter table BLC_ADDRESS add column PHONE_SECONDARY_ID bigint;
alter table BLC_CUSTOMER_PAYMENT add column IS_DEFAULT bit;
alter table BLC_FULFILLMENT_GROUP add column FULFILLMENT_GROUP_SEQUNCE integer;
alter table BLC_FULFILLMENT_GROUP_ITEM add column PRORATED_ORDER_ADJ numeric(19,2);
alter table BLC_FULFILLMENT_GROUP_ITEM add column TAXABLE_PRORATED_ORDER_ADJ numeric(19,2);
alter table BLC_FULFILLMENT_GROUP_ITEM add column TOTAL_ITEM_AMOUNT numeric(19,5);
alter table BLC_FULFILLMENT_GROUP_ITEM add column TOTAL_ITEM_TAXABLE_AMOUNT numeric(19,5);
create table BLC_ITEM_OFFER_QUALIFIER (ITEM_OFFER_QUALIFIER_ID bigint not null, QUANTITY bigint, OFFER_ID bigint not null, ORDER_ITEM_ID bigint, primary key (ITEM_OFFER_QUALIFIER_ID));
alter table BLC_OFFER add column MARKETING_MESSASGE varchar(255);
alter table BLC_ORDER_ITEM add column DISCOUNTS_ALLOWED bit;
alter table BLC_ORDER_ITEM add column RETAIL_PRICE_OVERRIDE bit;
alter table BLC_ORDER_ITEM add column SALE_PRICE_OVERRIDE bit;
alter table BLC_ORDER_ITEM add column TOTAL_TAX numeric(19,2);
create table BLC_ORDER_ITEM_DTL_ADJ (ORDER_ITEM_DTL_ADJ_ID bigint not null, APPLIED_TO_SALE_PRICE bit, OFFER_NAME varchar(255), ADJUSTMENT_REASON varchar(255) not null, ADJUSTMENT_VALUE numeric(19,5) not null, OFFER_ID bigint not null, ORDER_ITEM_PRICE_DTL_ID bigint, primary key (ORDER_ITEM_DTL_ADJ_ID));
create table BLC_ORDER_ITEM_PRICE_DTL (ORDER_ITEM_PRICE_DTL_ID bigint not null, QUANTITY integer not null, USE_SALE_PRICE bit, ORDER_ITEM_ID bigint, primary key (ORDER_ITEM_PRICE_DTL_ID));
alter table BLC_ORDER_PAYMENT add column CUSTOMER_PAYMENT_ID bigint;
create table BLC_ORDER_PAYMENT_DETAILS (PAYMENT_DETAIL_ID bigint not null, PAYMENT_AMOUNT numeric(19,2), DATE_RECORDED timestamp, PAYMENT_INFO_DETAIL_TYPE integer, CURRENCY_CODE varchar(255), PAYMENT_INFO bigint not null, primary key (PAYMENT_DETAIL_ID));
alter table BLC_PAYMENT_RESPONSE_ITEM add column TRANSACTION_AMOUNT numeric(19,5);
alter table BLC_ADDRESS add constraint FK299F86CEF1A6533F foreign key (PHONE_FAX_ID) references BLC_PHONE;
alter table BLC_ADDRESS add constraint FK299F86CEBF4449BA foreign key (PHONE_PRIMARY_ID) references BLC_PHONE;
alter table BLC_ADDRESS add constraint FK299F86CEE12DC0C8 foreign key (PHONE_SECONDARY_ID) references BLC_PHONE;
create index ADDRESS_PHONE_PRI_IDX on BLC_ADDRESS (PHONE_PRIMARY_ID);
create index ADDRESS_PHONE_SEC_IDX on BLC_ADDRESS (PHONE_SECONDARY_ID);
create index ADDRESS_PHONE_FAX_IDX on BLC_ADDRESS (PHONE_FAX_ID);
alter table BLC_ITEM_OFFER_QUALIFIER add constraint FKD9C50C619AF166DF foreign key (ORDER_ITEM_ID) references BLC_ORDER_ITEM;
alter table BLC_ITEM_OFFER_QUALIFIER add constraint FKD9C50C61D5F3FAF4 foreign key (OFFER_ID) references BLC_OFFER;
create index OFFER_MARKETING_MESSAGE_INDEX on BLC_OFFER (MARKETING_MESSASGE);
alter table BLC_ORDER_ITEM_DTL_ADJ add constraint FK85F0248FD5F3FAF4 foreign key (OFFER_ID) references BLC_OFFER;
alter table BLC_ORDER_ITEM_DTL_ADJ add constraint FK85F0248FD4AEA2C0 foreign key (ORDER_ITEM_PRICE_DTL_ID) references BLC_ORDER_ITEM_PRICE_DTL;
alter table BLC_ORDER_ITEM_PRICE_DTL add constraint FK1FB64BF19AF166DF foreign key (ORDER_ITEM_ID) references BLC_ORDER_ITEM;
alter table BLC_ORDER_PAYMENT add constraint FK9517A14FCA0B98E0 foreign key (CUSTOMER_PAYMENT_ID) references BLC_CUSTOMER_PAYMENT;
create index CUSTOMER_PAYMENT on BLC_ORDER_PAYMENT (CUSTOMER_PAYMENT_ID);
alter table BLC_ORDER_PAYMENT_DETAILS add constraint FK6D390732CE00A2EB foreign key (PAYMENT_INFO) references BLC_ORDER_PAYMENT;
alter table BLC_ORDER_PAYMENT_DETAILS add constraint FK6D3907323E2FC4F9 foreign key (CURRENCY_CODE) references BLC_CURRENCY;
create index BLC_SITE_ID_VAL_INDEX on BLC_SITE (SITE_IDENTIFIER_VALUE);