JBoss.orgCommunity Documentation

Lifecycle

A lifecycle is defined by a simple vertical workflow with steps (states) and profiles (membership). Each lifecycle is related to a Publication plugin (compliant with the JBPM or Bonita business processes).

For example: Two lifecycles with/without states



<external-component-plugins>
    <target-component>org.exoplatform.services.wcm.publication.PublicationManager</target-component>
    <component-plugin>
        <name>AddLifecycle</name>
        <set-method>addLifecycle</set-method>
        <type>org.exoplatform.services.wcm.publication.lifecycles.StatesLifecyclePlugin</type>
        <init-params>
            <object-param>
                <name>lifecyles</name>
                <object type="org.exoplatform.services.wcm.publication.lifecycles.impl.LifecyclesConfig">
                    <field name="lifecycles">
                        <collection type="java.util.ArrayList">
                            <value>
                                <object type="org.exoplatform.services.wcm.publication.lifecycles.impl.LifecyclesConfig$Lifecycle">
                                    <field name="name">
                                        <string>lifecycle1</string>
                                    </field>
                                    <field name="publicationPlugin">
                                        <string>States and versions based publication</string>
                                    </field>
                                </object>
                            </value>
                            <value>
                                <object type="org.exoplatform.services.wcm.publication.lifecycles.impl.LifecyclesConfig$Lifecycle">
                                    <field name="name">
                                        <string>lifecycle2</string>
                                    </field>
                                    <field name="publicationPlugin">
                                        <string>Authoring publication</string>
                                    </field>
                                    <field name="states">
                                        <collection type="java.util.ArrayList">
                                            <value>
                                                <object type="org.exoplatform.services.wcm.publication.lifecycles.impl.LifecyclesConfig$State">
                                                    <field name="state">
                                                        <string>draft</string>
                                                    </field>
                                                    <field name="memberships">
                                                        <collection type="java.util.ArrayList">
                                                            <value>
                                                                <string>author:/CA/communicationDG</string>
                                                            </value>
                                                            <value>
                                                                <string>author:/CA/alerteSanitaire</string>
                                                            </value>
                                                            <value>
                                                                <string>author:/CA/alerteInformatique</string>
                                                            </value>
                                                            <value>
                                                                <string>author:/CA/informations</string>
                                                            </value>
                                                        </collection>
                                                    </field>
                                                </object>
                                            </value>
                                            <value>
                                                <object type="org.exoplatform.services.wcm.publication.lifecycles.impl.LifecyclesConfig$State">
                                                    <field name="state">
                                                        <string>pending</string>
                                                    </field>
                                                    <field name="membership">
                                                        <string>author:/platform/web-contributors</string>
                                                    </field>
                                                </object>
                                            </value>
                                            <value>
                                                <object type="org.exoplatform.services.wcm.publication.lifecycles.impl.LifecyclesConfig$State">
                                                    <field name="state">
                                                        <string>approved</string>
                                                    </field>
                                                    <field name="membership">
                                                        <string>manager:/platform/web-contributors</string>
                                                    </field>
                                                </object>
                                            </value>
                                            <value>
                                                <object type="org.exoplatform.services.wcm.publication.lifecycles.impl.LifecyclesConfig$State">
                                                    <field name="state">
                                                        <string>staged</string>
                                                    </field>
                                                    <field name="membership">
                                                        <string>publisher:/platform/web-contributors</string>
                                                    </field>
                                                </object>
                                            </value>
                                            <value>
                                                <object type="org.exoplatform.services.wcm.publication.lifecycles.impl.LifecyclesConfig$State">
                                                    <field name="state">
                                                        <string>published</string>
                                                    </field>
                                                    <field name="membership">
                                                        <string>automatic</string>
                                                    </field>
                                                </object>
                                            </value>
                                        </collection>
                                    </field>
                                </object>
                            </value>
                            <value>
                                <object type="org.exoplatform.services.wcm.publication.lifecycles.impl.LifecyclesConfig$Lifecycle">
                                    <field name="name">
                                        <string>lifecycle3</string>
                                    </field>
                                    <field name="publicationPlugin">
                                        <string>Authoring publication</string>
                                    </field>
                                    <field name="states">
                                        <collection type="java.util.ArrayList">
                                            <value>
                                                <object type="org.exoplatform.services.wcm.publication.lifecycles.impl.LifecyclesConfig$State">
                                                    <field name="state">
                                                        <string>draft</string>
                                                    </field>
                                                    <field name="membership">
                                                        <string>author:/platform/web-contributors</string>
                                                    </field>
                                                </object>
                                            </value>
                                            <value>
                                                <object type="org.exoplatform.services.wcm.publication.lifecycles.impl.LifecyclesConfig$State">
                                                    <field name="state">
                                                        <string>published</string>
                                                    </field>
                                                    <field name="memberships">
                                                        <collection type="java.util.ArrayList">
                                                            <value>
                                                                <string>publisher:/CA/communicationDG</string>
                                                            </value>
                                                            <value>
                                                                <string>publisher:/CA/alerteSanitaire</string>
                                                            </value>
                                                            <value>
                                                                <string>publisher:/CA/alerteInformatique</string>
                                                            </value>
                                                            <value>
                                                                <string>publisher:/CA/informations</string>
                                                            </value>
                                                        </collection>
                                                    </field>
                                                </object>
                                            </value>
                                        </collection>
                                    </field>
                                </object>
                            </value>
                        </collection>
                    </field>
                </object>
            </object-param>
        </init-params>
    </component-plugin>
</external-component-plugins>

In the last example, there are three lifecycles: