Create a custom workflow action class

 

+

Search Tips   |   Advanced Search

 

You can create custom workflow action classes to enable you to use custom workflow actions in a workflow.


Create the custom workflow action class

  1. Create a java class that implements the interface...

    This class must implement the following methods:

    A custom workflow action result object is created by first retrieving a reference to the object...

    ...and then calling the method...

      webContentCustomWorkflowService.getCustomWorkflowService().createResult(Directive, String)

    If the CustomWorkflowActionResult does not indicate a failure, changes to the document will be saved.

    See the Web Content Management Javadoc

    Also see the Web Content Management Javadoc for further information on valid directives.

  2. Create a custom workflow action factory class that implements the interface...


Create a plugin.xml file

Create a new file...

...that contains...

<?xml version="1.0" encoding="UTF-8"?>

<plugin id="com.ibm.workplace.wcm.api.custom"
        name="Sample Custom Workflow Action Factory"
        version="1.0.0"
        provider-name="IBM">
        
  <extension-point id="CustomWorkflowActionFactory" name="CustomWorkflowActionFactory"/>
  
  <extension point="com.ibm.workplace.wcm.api.custom.CustomWorkflowActionFactory"
             id="SimpleCustomWorkflowActionFactory">

     <provider class="com.ibm.workplace.wcm.sample.customworkflowaction.SimpleCustomWorkflowActionFactory"/>

  </extension>
 
</plugin>

You must now compile the java classes and create a portal application.

This can either be an "ear" or "war" file.


Deploy the ear file in the Administrative Console

To ensure the new workflow action class is available each time your server is started you can register the ear file in the Administrative Console:

  1. Select...

      Applications | New Application | New Enterprise Application | Ear_file

  2. Select next until you reach Step 2. Map modules to servers

  3. Select the tickbox for the custom action module

  4. In the Clusters and Servers section, select WebSphere_Portal and select apply

  5. Keep selecting next until the end when you select finish

  6. The screen titled updating will be shown. Select Manage Applications.

  7. Locate and select the application you just installed. Default name:
      WCM Sample Custom Workflow Action

  8. Under Detail Properties select Startup behavior.

  9. Under General Properties modify the Startup order to be the same weight as "wcm" and select Apply. By default, the weight is 20.

  10. Select Save directly to master configuration.

To update an existing ear file:

  1. Select...

      Applications | Application Types | WebSphere enterprise applications | Application_name

  2. Select the tickbox for the custom action application and click on update

  3. Select upload the replacement application and browse for the ear file

  4. Keep selecting next until the end when you select finish

  5. The screen titled 'updating' will be shown. Select Save to Master Configuration and then click save.


Create a custom workflow action

Once your java class is installed, you can create a custom workflow action. The custom workflow action can be added to a workflow stage just like any other workflow action.


Parent topic:

Creating custom plug-ins