Try OpenEdge Now
skip to main content
Application Developer's Guide
Using Callback Adapter : Developing the Callback Adapter : Understanding the XML structure
 

Understanding the XML structure

A typical callback XML file looks like:
<Callbacks>
    <ServerCallbacks>
        <Location>D:\sbm\ebmsapps\common\callback</Location>
        <ServerCallback name="BPM Events">
            <OnShutdown invoke="after">
                <AdapterClass method="stop">
    com.savvion.adapters.ServerCallback2</AdapterClass>
            </OnShutdown>
    </ServerCallback>
        <ServerCallback name="BP Server">
<OnSuspend invoke="after">
        <AdapterClass method="suspend">
com.savvion.adapters.ServerCallback4</AdapterClass>
    </OnSuspend>
    </ServerCallback>
    </ServerCallbacks>
    <ProcessCallbacks>
        <ProcessTemplateCallback name="ptHiring">
            <Filter>
                <ProcessTemplate name="Hiring" isAppName="false" />
                <ProcessTemplate name="Approval" isAppName="true" />
            </Filter>
            <OnActivate invoke="after">
                <AdapterClass method="activate">ProcessCallback1
                </AdapterClass>
            </OnActivate>
        </ProcessTemplateCallback>
        <ProcessInstanceCallback name="piHiring">
            <Filter>
                <ProcessTemplate name="Hiring" isAppName="false" />
            </Filter>
            <OnRemove invoke="after">
                <AdapterClass method="remove">ProcessCallback4
                </AdapterClass>
            </OnRemove>
            <OnComplete invoke="after">
                <AdapterClass method="complete">ProcessCallback4
                </AdapterClass>
            </OnComplete>
        </ProcessInstanceCallback>
<WorkstepInstanceCallback name="wiHiring">
<Filter>
<ProcessTemplate name="Hiring" isAppName="false">
<Workstep>Evaluate Resume</Workstep>
<Workstep>Feedback</Workstep>
</ProcessTemplate>
</Filter>
<OnActivate>
<AdapterClass method="activate"> ProcessCallback4</AdapterClass>
</OnActivate>
<OnComplete>
<AdapterClass method="complete"> ProcessCallback4</AdapterClass>
</OnComplete>
</WorkstepInstanceCallback>

    </ProcessCallbacks>
</Callbacks>
This is a sample callback configuration file. The classes mentioned in this XML file do not exist in Business Process Server installation. You need to develop the callback classes and update the XML file appropriately before using them.
The various tags in the XML file are described below.
*<Callbacks> — Root tag
*<ServerCallbacks> — Contains callback information about the servers - BP Server and BPM Events.
*<Location> — Provides location of the adapter class files. The default location is OEBPS_HOME\ebmsapps\common\callback. This tag is optional. If not included, then the default location of the class files is OEBPS_HOME\ebmsapps.
For an application-specific callback, the default location is OEBPS_HOME\ebmsapps\<application name>\callback. For example, in the case of Hiring application, the default location of the callback adapter class is OEBPS_HOME\ebmsapps\Hiring\callback.
*<OnStart>, <OnShutdown>, <OnSuspend>, <OnResume>: Provide the Server state that invokes the defined classes. Attribute invoke defines the time of invocation, and can take values before, after or both.
*<AdapterClass> — Defines the class to be invoked. Attribute method contains the method name.
*<ProcessCallbacks> — Contains callback information about BP Server process (application). It contains zero or one instance of <Location> tag and zero or more instances of <ProcessTemplateCallback> and <ProcessInstanceCallback> tags.
*<ProcessTemplateCallback> — An example is shown here:
    <ProcessCallbacks>
        <ProcessTemplateCallback name="ptHiring">
            <Filter>
                <ProcessTemplate name="Hiring" isAppName="false">
                <ProcessTemplate name="Approval" isAppName="true">
            </Filter>
            <OnActivate invoke="after">
                <AdapterClass method="activate">ProcessCallback1
                </AdapterClass>
            </OnActivate>
        </ProcessTemplateCallback>
    </ProcessCallbacks>
The name attribute contains a string value for callback name, which should be unique among all callback tags.
The isAppName attribute can take values true or false. In the above example, isAppName has value as false, indicating that the name specified (in this case, 'Hiring') is that of the BP Server process template. If isAppName has value as true, then the name is taken as the generic application name, which is the common name for multiple versions of BP Server process templates.
Note that for ProcessCallback, the invoke attribute can have only one value as after.
The <ProcessTemplateCallback> tag can have maximum one instance of <Filter> tag, and maximum one instance of each of the state change tags. The possible state change tags are: <OnActivate>, <OnSuspend>, <OnResume>, and <OnRemove>.
*<Filter> — Contains information about the filter conditions that are applicable to the callback. In the above example, the Callback Adapter is registered for process template state change, which is activation of the process template. With the filter conditions specified as process template name 'Hiring', this call back is applicable only to 'Hiring' process template. Please note that there can be zero or more <ProcessTemplate> tags within the <Filter> tag.
If the <Filter> tag is omitted, then it is assumed that the callback is applicable to all process templates.
The filter conditions are kept at the state change level, within the callback tags. As multiple callback tags are supported (multiple ProcessTemplateCallback tags in this case), the user can specify different filter conditions under different callback tags.
In the above example, the activate method of the adapter class ProcessCallback1 is called when Hiring process template is activated.
*<ProcessInstanceCallback> — An example is shown here:
    <ProcessInstanceCallback name="piHiring">
        <Filter>
            <ProcessTemplate name="Hiring" isAppName="false" />
        </Filter>
        <OnRemove invoke="after">
            <AdapterClass method="remove">ProcessCallback4
            </AdapterClass>
        </OnRemove>
        <OnComplete invoke="after">
            <AdapterClass method="complete">ProcessCallback4
            </AdapterClass>
        </OnComplete>
    </ProcessInstanceCallback>
The name attribute contains a string value for callback name, which should be unique among all callback tags.
The <ProcessInstanceCallback> tag can have maximum one instance of <Filter> tag, and maximum one instance of each of the state change tags. The possible state change tags are: <OnRemove> and <OnComplete>.
* <WorkstepInstanceCallback> — An example is shown here:
<WorkstepInstanceCallback name="wiHiring">
<Filter>
<ProcessTemplate name="Hiring" isAppName="false">
<Workstep>Evaluate Resume</Workstep>
<Workstep>Feedback</Workstep>
</ProcessTemplate>
</Filter>
<OnActivate>
<AdapterClass method="activate"> ProcessCallback4</AdapterClass>
</OnActivate>
<OnComplete>
<AdapterClass method="complete"> ProcessCallback4</AdapterClass>
</OnComplete>
</WorkstepInstanceCallback>
The name attribute contains a string value for callback name, which should be unique among all callback tags.  
The <WorkstepInstanceCallback> tag can have maximum one instance of <Filter> tag, and maximum one instance of each of the state change tags. The possible state change tags are: <OnActivate> and <OnComplete>.
*<WorkStep> -- The workstep name for which we want to execute the callback adapter on state changes. For workstep instance call back, <ProcessTemplate> can have 0 or many <WorkStep> tags.