Select version
v7.7 v7.6 v7.5 v7.3 v7.1 v7.0 v6.8 v6.7 v6.6 v6 v5 v4 v3 v2

Initialize Pipeline

The initialize pipeline is run once every time application starts up, which means you can use it to hook in code that you want to execute right after the application are started and before a user visits the uCommerce-backoffice.

In the sample app project we have an example where the initialize pipeline is use to run a custom pipeline, which creates and maintains a product definition.

You hook into the pipeline by creating a custom pipeline task and register it in the uCommerce configuration.

Here is an example on how to implement a custom pipeline task for the initialize pipeline.

    
    	public class CustomPipelineTask : IPipelineTask<InitializeArgs>
    	{
    		public PipelineExecutionResult Execute(InitializeArgs subject)
    		{
    			throw new NotImplementedException();
    		}
    	}
    

Here is an example on how to use partial components to add a custom pipeline task to the initialize pipeline.

    
    <configuration>
    	<components>
    		<!-- Adds the custom pipeline task to the Initialize pipeline -->
    		<partial-component id="Initialize">
    			<parameters>
    				<tasks>
    					<array>
    						<item insert="last">${MyCustomPipelineTask}</item>
    					</array>
    				</tasks>
    			</parameters>
    		</partial-component>
    
    		<!-- Configuration of your custom pipeline task -->
    		<component id="MyCustomPipelineTask"
    				service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.Pipelines.Initialization.InitializeArgs, UCommerce.Pipelines]], UCommerce"
    				type="MyNamespace.MyClassName, MyAssembly" />
    	</components>
    </configuration>
    
uCommerce Aps - Studsgade 29B - 8000 Aarhus C - Denmark
Phone +45 61 799 997 - Email [email protected] uCommerce logo