Search code examples
springspring-mvcthymeleafbroadleaf-commerce

How to remove an Activity from a WorkFlow in BroadleafCommerce?


We are using BroadleafCommerce . I have a requirement to remove ValidateAddRequestActivity from AddItemWorkFlow. I have given same order to my Activity same as ValidateAddRequestActivity. Still I am getting it in activities . How can I remove ValidateAddRequestActivity activity and will place my own.

Here is my code snippet How I am overriding this. Thanks in Advance. 



<bean p:order="1000" id="xxSkuValidate"
        class="com.xxxxx.workflow.ValidateSkuAddToCart " />


    <bean id="blAddItemWorkflow" class="org.broadleafcommerce.workflow.SequenceProcessor">
        <property name="activities">
            <list>
                <ref bean="xxSkuValidate"/>
            </list>
        </property>
    </bean>

Solution

  • You have many possibilities, but if you actually want to replace blValidateAddRequestActivity with class

    org.broadleafcommerce.core.order.service.workflow.add.ValidateAddRequestActivity

    you simply declare a bean with same id blValidateAddRequestActivity and different implementation

    com.xxxxx.workflow.ValidateSkuAddToCart

    example :

    <bean p:order="1000" id="blValidateAddRequestActivity" class="com.xxxxx.workflow.ValidateSkuAddToCart"/>
    

    but if you want just to remove it, I can give you only an 'work around' from my perspective. having a NOP implementation for that bean with id blValidateAddRequestActivity that actually does nothing.

    Hope this helps