eXo Platform 3.0

- Prev
- Next

## Chapter 8. FAQ

## How to deploy a workflow?

The addPlugin() function of WorkflowServiceContainer service is used to register a Business Process when a workflow is implemented. Thus, if you want to use a workflow, you are required to configure the workflow service to invoke the addPlugin() function by adding the external-component-plugins element to the configuration file.

You have to set values for the name and location of the workflow which you want to use. There are TWO ways to configure the location of the workflow.

### Deploy a workflow inside a .war file

You can use "war:(FOLDER_PATH)" to configure which .jar files contain your workflow processes inside the .war file.

    <external-component-plugins>
    	<target-component>org.exoplatform.services.workflow.WorkflowServiceContainer</target-component>
    	<component-plugin>
    		<name>deploy.predefined.processes</name>
    		<set-method>addPlugin</set-method>
    		<type>org.exoplatform.services.workflow.PredefinedProcessesPlugin</type>
    		<init-params>
    			<object-param>
    				<name>predefined.processes</name>
    				<description>load of default business processes</description>
    				<object type="org.exoplatform.services.workflow.ProcessesConfig">
    					<field name="processLocation"><string>war:/conf/bp</string></field>
    					<field name="predefinedProcess">
    						<collection type="java.util.HashSet">
    							<value><string>/exo-ecms-ext-workflow-bp-jbpm-content-2.1.1.jar</string></value>
    							<value><string>/exo-ecms-ext-workflow-bp-jbpm-payraise-2.1.1.jar</string></value>
    							<value><string>/exo-ecms-ext-workflow-bp-jbpm-holiday-2.1.1.jar</string></value>
    						</collection>
    					</field>
    				</object>
    			</object-param>
    		</init-params>
    	</component-plugin>
    </external-component-plugins>

### Deploy a workflow inside a .jar file

You can use "classpath:" to configure which .jar files contain your workflow processes inside the .jar file.

    <external-component-plugins>
    	<target-component>org.exoplatform.services.workflow.WorkflowServiceContainer</target-component>
    	<component-plugin>
    		<name>deploy.predefined.processes</name>
    		<set-method>addPlugin</set-method>
    		<type>org.exoplatform.services.workflow.PredefinedProcessesPlugin</type>
    		<init-params>
    			<object-param>
    				<name>predefined.processes</name>
    				<description>load of default business processes</description>
    				<object type="org.exoplatform.services.workflow.ProcessesConfig">
    					<field name="processLocation"><string>classpath:</string></field>
    					<field name="predefinedProcess">
    						<collection type="java.util.HashSet">
    							<value><string>/exo-ecms-ext-workflow-bp-jbpm-content-myworkflow.jar</string></value>
    						</collection>
    					</field>
    				</object>
    			</object-param>
    		</init-params>
    	</component-plugin>
    </external-component-plugins>

The notification message is displayed when you deploy a workflow on Jboss. If you use "classpath:" to register, you must put your workflow in the .jar files inside the gatein.ear/lib folder (instead of the lib folder) to make it work.

- Prev
- Up
- Home
- Next