Try OpenEdge Now
skip to main content
Application Developer's Guide
Using custom dataslots : Defining custom dataslots with complex objects : Defining custom dataslots : Initializing the MyTable custom Object dataslot
 
Initializing the MyTable custom Object dataslot
You must initialize the MyTable custom Object dataslot before you can use it in the process template.
To initialize the custom object dataslot:
1. From the Assign participants link in the Tasks pane, drag the New Adapter icon to the process template to open the New Adapter dialog box.
2. Enter a unique name for the new adapter in the Name box, in this case MyTableAdapter.
3. In the Class box, define the class that invokes the adapter containing the objects (for instance, com.savvion.BPM Workflow.beans.DsPrototypeFactory).
Figure 12. Defining factory adapter properties
Note: The Method box is not enabled. You are only able to use the commit method for BPM Workflow adapters.
4. Click OK to add the adapter workstep.
5. From the Properties view for this workstep, use the Dataslots tab to specify the input and output dataslots.
a. Click Add to open the Select Dataslots dialog box.
b. Select the MyClass, MyTable, and queryString dataslots and then click OK to add these dataslots to MyTableAdapter.
c. For the MyClass and queryString dataslots, click in the Output from Adapter column, and select false in the respective cells.
d. Similarly, specify the MyTable dataslot as output to the new adapter by selecting false in the Input to Adapter column.
The Properties view for the MyTableAdapter workstep now indicates the input and output dataslots you have just defined.
Figure 13. Inputs and outputs in the properties view
6. To map the input custom dataslots:
a. Select Advanced option from the drop-down list.
b. Select the MyClass custom dataslot and click Modify, to open the Field Properties dialog box.
c. Click the ellipsis button next to the Adapter input(s) box, to open the Adapter Input(s) dialog box.
d. Type "className" in the text box provided, and click Add. If necessary, then remove other inputs.
e. Click OK, returning to the Field Properties dialog box, where className is now shown as the Adapter input. You have mapped the MyClass custom dataslot to the className dataslot.
f. Click OK, and return to the MyTableAdapter Properties view, with the Advanced view displayed.
g. Map the queryString dataslot to Query by following Step 6a to Step 6f, substituting queryString for MyClass and Query for className.
When using the DsPrototypeFactory, you must not map output custom dataslots since DsPrototypeFactory handles this mapping.
7. Click File > Save or the Save icon to save the changes.
The dataslot can then be used as input in any of the subsequent activity worksteps in the process template. The activity workstep recognizes the dataslot as a custom slot (through reflection technique) and invokes its getPresentation() method to get the presentation for the dataslot.
Note: For backward compatibility with previously developed applications, object dataslots defined with the full class name of the object or with UserDefinedDS in the Value box are also valid. UserDefinedDS distinguishes the object dataslot with a custom interface. Use an Adapter (MyTableFactory) to initialize the dataslot.