78
EMC ® Documentum ® Process Builder Version 6.5 Development Guide P/N 300-007-248 A01 EMC Corporation Corporate Headquarters: Hopkinton, MA 01748-9103 1-508-435-1000 www.EMC.com

EMC Documentum ProcessBuilder · EMC®Documentum® ProcessBuilder Version6.5 DevelopmentGuide P/N300-007-248A01 EMCCorporation CorporateHeadquarters: Hopkinton,MA01748-9103 1-508-435-1000

Embed Size (px)

Citation preview

EMC® Documentum®

Process BuilderVersion 6.5

Development GuideP/N 300-007-248 A01

EMC CorporationCorporate Headquarters:

Hopkinton, MA 01748-91031-508-435-1000www.EMC.com

Copyright © 2004 - 2008 EMC Corporation. All rights reserved.

Published July 2008

EMC believes the information in this publication is accurate as of its publication date. The information is subject to changewithout notice.

THE INFORMATION IN THIS PUBLICATION IS PROVIDED AS IS. EMC CORPORATION MAKES NO REPRESENTATIONSOR WARRANTIES OF ANY KINDWITH RESPECT TO THE INFORMATION IN THIS PUBLICATION, AND SPECIFICALLYDISCLAIMS IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Use, copying, and distribution of any EMC software described in this publication requires an applicable software license.

For the most up-to-date listing of EMC product names, see EMC Corporation Trademarks on EMC.com.

All other trademarks used herein are the property of their respective owners.

Table of Contents

Preface ........................................................................................................................... 7

Chapter 1 Using Custom Email Templates .............................................................. 9Custom email templates overview ................................................................ 9Creating custom email template objects........................................................ 10Sample template content ......................................................................... 13

Troubleshooting email template notification ................................................. 14

Chapter 2 Developing Custom Activities ............................................................... 17Writing the Java class .................................................................................. 18Creating a method object............................................................................. 21Sample code ............................................................................................... 22

Chapter 3 Activity template denition le schema ................................................ 25

EMC Documentum Process Builder Version 6.5 Development Guide 3

Table of Contents

List of Figures

Figure 1. Sample Workflow Java Method ....................................................................... 19Figure 2. XsltTransformationActivity Workflow Class..................................................... 22

4 EMC Documentum Process Builder Version 6.5 Development Guide

Table of Contents

List of Tables

Table 1. <dmp:param> Tags ......................................................................................... 11Table 2. <activity> Element attributes ........................................................................... 26Table 3. <label> Element attributes ............................................................................... 36Table 4. <list_specification> Element attributes.............................................................. 37Table 5. <locale> Element attributes.............................................................................. 39Table 6. <minInclusive> Element attributes ................................................................... 41Table 7. <maxLength> Element attributes ..................................................................... 42Table 8. <minInclusive> Element attributes ................................................................... 43Table 9. <minLength> Element attributes ...................................................................... 44Table 10. <nlsid> Element attributes ............................................................................... 46Table 11. <query_specification> Element attributes ......................................................... 55Table 12. <package_specification> Element attributes ...................................................... 57Table 13. <parameter> Element attributes ....................................................................... 59Table 14. <parameter_display> Element attributes .......................................................... 61Table 15. <parameter_display_id> Element attributes ...................................................... 63Table 16. <tab> Element attributes.................................................................................. 71

EMC Documentum Process Builder Version 6.5 Development Guide 5

Table of Contents

6 EMC Documentum Process Builder Version 6.5 Development Guide

Preface

Purpose of the manualThis manual explains how to develop workflow methods that can be linked to customautomated activities using EMC Documentum Process Builder. It also describes how tocreate custom email notification messages for workflow events and provides referenceinformation for creating custom activity templates. Refer to the Process Builder User Guidefor information about creating business process templates and linking these customenhancements into a process template.

Intended audienceThis manual is intended for developers who are customizing business processes createdusing EMC Documentum Process Builder. It assumes some familiarity with basicDocumentum functionality, especially with Documentum Foundation Classes (DFC)programming.

Revision historyThis section contains a description of this document’s revision history.

Revision history

Revision Date Description

July 2008 Initial publication

Support informationEMC Documentum’s technical support services and policies are available at the EMCPowerlink website (http://Powerlink.EMC.com).

Note: You must register online at Powerlink before using it.

EMC Documentum Process Builder Version 6.5 Development Guide 7

Preface

Related documentationProcess Builder is a design tool for business process templates. Workflows are createdfrom these templates at runtime; see the user documentation for Documentum Webtopfor information about running and participating in workflows.

In addition to this manual, the documentation set for Process Builder includes:

• Documentum Process Builder User Guide• Documentum Process Builder Installation Guide• Documentum Process Builder Release Notes• Documentum Process Builder Localization Guide

8 EMC Documentum Process Builder Version 6.5 Development Guide

Chapter 1Using Custom Email Templates

This chapter describes using custom email templates for releases prior to Documentum ProcessBuilder 6, SP1 and contains the following sections:• Custom email templates overview, page 9• Creating custom email template objects, page 10

Note: Process designers can now use Process Builder’s Notification Template Wizard to create customemail templates dynamically while defining a process or an individual activity. The NotificationTemplate Wizard is available from the Process Template Properties and from the Notification andTimers tabs of the Activity Inspector. The Notification Wizard includes the ability to use datamapping to define the attributes of the email message. This chapter is included in the documentationfor backward compatibility purposes.

Custom email templates overviewWorkflows can generate email from Content Server to the workflow supervisor or toan activity performer when a particular event occurs. You can set the formatting andcontent of the notification messages using custom email templates. Email templates aredocuments whose content and attributes define a notification message. The message textcan include a variety of parameters that are resolved at runtime, to tailor the message fora specific context and instance. For example, you can include variables that resolve to thenames of package components, the workflow name, or the performer name.

Email templates are associated with specific workflow events as part of the definitionof a process template or an activity definition. When an event has an email templateassociated with it, any user who has registered to receive notification of the event willget a message generated from the associated email template. If it is associated withan activity definition, the template is only used when the event occurs in activitiesgenerated from that definition. If different templates are associated with the event in theactivity definition and the process template definition, the one in the activity definitiontakes precedence.

EMC Documentum Process Builder Version 6.5 Development Guide 9

Using Custom Email Templates

Note: The server generates and sends notification messages only when one or moreusers has registered to receive notification of the event. See Documentum Content ServerFundamentals for information about registering for event notifications.

To create a custom email template for a workow event:1. Create the email template object.

Creating custom email template objects, page 10 contains instructions for creatingthe template content.

2. Import the template in to the repository, in any folder.

3. Associate the template with a process template or activity definition.See the Process Builder User Guide for instructions.

Email templates are not recognized by the default method that Content Server uses forsending notifications, dm_event_sender. To use email templates, you must configureContent Server to use the alternative mail method, dm_event_template_sender. Thismethod is installed with Process Builder. For instructions on configuring Content Serverto use this method, refer to the Process Builder Installation Guide.

Creating custom email template objects

Caution: This section outlines the basic procedure for creating custom emailtemplates. Documentum provides standard technical support for using thedelivered sample email template as part of the product release. For assistancein creating, implementing, or debugging a custom email template, contactDocumentum Professional Services or Documentum Developer support.

An email template is a dm_sysobject, typically a dm_document object, whose contentand attributes define a notification email message. The content of the template definesthe body of the message in the form of a Java Server Page (JSP) file.

The file must begin with these two lines:<%@ page contentType="text/html; charset=UTF-8" %><%@n taglib uri="/dmp" prefix="dmp" %>

The subject line of the message is defined by the <title> element in the <head> section ofthe HTML file generated from the JSP file; see Sample template content, page 13 for anexample.

The email template can include any standard HTML or JSP tag. In addition, the customJSP tag library loaded by the second line shown above provides a set of tags that enableyou to include runtime variables from the workflow. At runtime, the tags are replacedwith their current values before sending the email message. The variables are enclosed

10 EMC Documentum Process Builder Version 6.5 Development Guide

Using Custom Email Templates

within <dmp: param> tags in the template content. For example, suppose the templateincludes the following text:You have been assigned a task in repository <dmp:param>docbase_name</dmp:param>.

Assuming the repository is named Engineering, when the email is sent, this is resolved to:You have been assigned a task in repository Engineering.

The tags enable you to use values from four main categories:

• Task attributes, where a task is an instance of a workflow activity assigned to aparticular performer

• Workflow attributes, where a workflow is an instance of a business process• Document attributes, where documents are the content contained in a workflow

package• Email-related attributes, such as the name of the sender or the SMTP serverThe table below lists the available tags in the custom tag library and the value eachrepresents. The values of some tags vary depending on the event that invokes themethod. We recommend turning on tracing for the method to see what values are beingused in the context you want to use it in.

Note: Process Builder includes a sample email template that illustrates the use of tags.You can find Sample WF Event Notification E-mail Template.jsp in the repository folder/System/Applications/Business Process Manager.

Table 1. <dmp:param> Tags

Tag Description

task.id The task ID

task.performer The performer of the task

task.priority The priority value assigned to the task

task.state The current state of the task, represented as an integer

task.qitem_id The ID of the Inbox item associated with the task

task.auto_method_id The ID of the method definition for an automaticactivity; if the task is not an automatic activity, thevalue of the variable is "0000000000000000".

task.creation_date The date when the task was created

task.due_date The due date for the task

task.name The name of the activity

task.act_id The ID of the activity that generated the task

task.number The sequence number within the workflow of theactivity that generated the task

EMC Documentum Process Builder Version 6.5 Development Guide 11

Using Custom Email Templates

Tag Description

task.pre_timer The date when the pre-timer for the task expires

task.post_timer The date when the post-timer for the task expires

workflow.id The ID of the workflow

workflow.name The name of the workflow

workflow.creator The user name of the person who created theworkflow

workflow.supervisor The user name of the person identified as theworkflow supervisor (the workflow creator bydefault)

workflow.instructions The text from theWorkflow Instructions text box inthe Workflow Template Properties dialog box

workflow.process_ID The ID of the process template from which theworkflow was generated

workflow.start_date The date when the workflow was started

doc.id The ID of a document from a workflow package (froma collection; see below)

doc.name The name of a document from a workflow package(from a collection; see below)

note.id The ID of a note attached to a document (from acollection; see below)

note.writer The name of the person who created the note (from acollection; see below)

note.text The text of a note attached to a document (from acollection; see below)

note.creation_date The date when a note was created (from a collection;see below)

docbase_name The name of the repository

event_name Name of the event that generated the email

sender_name The value in the email sender’s user_name attribute

message_text The Task Instructions from the activity

web_server_loc The location of the web server, as specified in theContent Server server config object

web_server_port The port of the web server, as specified in the ContentServer server config object

12 EMC Documentum Process Builder Version 6.5 Development Guide

Using Custom Email Templates

Tag Description

web_server_type The type of the Web server, as specified in the ContentServer server config object (rightsite_image)

smtp_server The name of the SMTP server, as specified in theContent Server server config object

alias.alias_set.alias_name System alias

The doc and note tags represent values from the documents being routed and notesattached to those documents. Documents and notes are available to your JSP page in theform of collections; to use these tags, you first have to retrieve an individual document ornote from the collection. You retrieve an individual item by using the tags inside of aprogramming loop, as shown in this sample code:<dmp:foreach collection="doc">

<dmp:row>doc.id</dmp:row><dmp:row>doc.name</dmp:row>

</dmp:foreach><dmp:foreach collection="note">

<dmp:row>note.id</dmp:row></dmp:foreach>

The <dmp:foreach> tag enables you to loop through all documents in all packages,or all notes in all packages. The order in which documents or notes are returned isindeterminate.

Sample template content

Here is a sample template content.<%@ page contentType="text/html; charset=UTF-8" %><%@n taglib uri="/dmp" prefix="dmp" %>

<html><head>

<title>New Task: <dmp:param>task_name</dmp:param> in repository<dmp:param>docbase_name</dmp:param></title></head>

<body>

<p>The following task has arrived in your Documentum Inbox.</p>;

<table><tr>

<td>Task Name:</td><td><dmp:param>task.name</dmp:param></td></tr><tr>

<td>Priority:</td><td><dmp:param>task.priority</dmp:param></td>

EMC Documentum Process Builder Version 6.5 Development Guide 13

Using Custom Email Templates

</tr><tr>

<td>Instructions:</td><td><dmparam>message_text</dmparam></td></tr>

</table>

<p>Click here to open the task in Webtop:</p><p>http://<dmp:param>alias.WebtopAlias.Webtop_HOSTPORT</dmp:param>/webtop/

drl/objectId/<dmp:param>task.qitem.id</dmp:param></p>

</body>

</html>

Troubleshooting email template noticationWhen you create email templates and associate them with workflow events in a processtemplate, Content Server uses the email template to construct the notification message itsends when the workflow event occurs. If the notification messages are not based on theemail template, but instead are the standard Documentum notification messages, followthese steps to try to locate the problem.

Note: The troubleshooting procedure assumes that you are familiar with Documentumadministration procedures such as reviewing configuration attributes, tracing servermethods, and restarting processes. See the Content Server Administrator’s Guide forfurther details about performing the tasks described below.

To investigate why Content Server is not using an email template:1. If none of your email templates are being used, check the mail-related attributes in

the server config object (dm_server_config).Email template-based notification depends on four configuration attributes:

Attribute Required Setting

mail_method dm_event_template_sender

smtp_server The host name of the SMTP server usedfor sending mail

14 EMC Documentum Process Builder Version 6.5 Development Guide

Using Custom Email Templates

Attribute Required Setting

app_server_name This repeating attribute must havedo_mail as one of its values

app_server_uri This repeating attribute must havethe URI for the do_mail servlet inthe same position as do_mail inthe app_server_name attribute; forexample: http://localhost:9080/DmMail/servlet/DoMail

These attributes are not displayed through Documentum Administrator, so you needto use the Content Server API to view the dm_server_config object.

2. If none of your email templates are being used, restart the Documentum Java MethodServer (on the Content Server host) to ensure that the DmMail servlet has beendeployed.• On Microsoft Windows, restart the Documentum Java Method Server service.• On UNIX, run the shutdown.sh and startup.sh scripts in the directory

$DM_HOME/<jboss directory>/bin.3. If a particular email template is not being used, check its syntax.

If an email template file has a syntax error, Content Server uses the standardDocumentum notification message in its place; that is, it sends the same messageas the dm_event_sender method does. Content Server installs a servlet namedTestTemplate on the same application server as the do_mail servlet. You can use it todetect syntax errors in a JSP email template file.

a. Open a Web browser and enter the URI for the TestTemplate servlet. The URIis the same as the URI for the do_mail servlet (see step 1) with TestTemplate inplace of DoMail. For example:http://localhost:9080/DmMail/servlet/TestTemplate

The Test Email Template Web page appears.

b. Copy and paste the contents of the JSP email template into the text area, then clickthe Test button at the bottom of the page. The servlet reports any syntax errors.

c. Correct any reported errors in the email template object.

4. Turn on tracing for the dm_event_template_sender method.Set the trace_launch attribute of the method object to T. The trace information willbe written into the standard JBoss log file for the Documentum Java Method Serverunless another file name is specified in the method object.

5. Use the Content Server API to queue the event that should send the notificationmessage.You need to know the Object ID of a work item to perform this step. Use this syntax:

EMC Documentum Process Builder Version 6.5 Development Guide 15

Using Custom Email Templates

queue,session,workitem_ID,,workflow_event,priority,T,,text

For example:queue,s0,4a0387408004e900,,dm_startedworkitem,0,T,,'Hi'

This API call sends mail to the performer of the task. Check the log file for detailsabout the operation of dm_event_template_sender.

6. When you have debugged the problem, turn off tracing for dm_event_template_sender.

16 EMC Documentum Process Builder Version 6.5 Development Guide

Chapter 2Developing Custom Activities

An automatic activity is an activity that the system performs without user intervention by runninga Java method. You define an automatic activity in Process Builder by identifying the Java methodon the Performers tab in the Activity Inspector. When the activity is triggered, the workflow enginecalls the Java method, passing it information about the current workflow context, including the workitem. The method runs on the Content Server’s Java Method Server. It acquires the workflow task andcompletes it. When the method completes, control returns to the workflow engine.

To develop and deploy a custom workow method:1. Write a Java class that performs the task of the workflow activity.

To write a workflow-specific method, write a Java class that extends theabstract class WorkflowMethod, which is defined in the bpmutil.jar file in theDOCUMENTUM_SHARED directory. Your class must implement the doTask( )method that performs the main action of the class. The workflow engine passes threeparameters to the doTask( ) method: the work item object associated with the task,an IDfProperties structure containing any custom activity parameters specified inthe activity template for this activity, and a PrintWriter pointing to the log file.See Writing the Java class, page 18 for more information about the requirements forthe Java class and sample code.

2. Compile the Java class.

3. Copy the .class file to the %DOCUMENTUM%\dba\java_methods directory on theContent Server machine.

4. Create a Documentum method object that references the method.To make your custom method available in Process Builder, you need to create amethod object for it. In addition to referencing the Java class, the method object mustexplicitly identify the method as being used for workflow.See Creating a method object, page 21 for more information about creating themethod object.

5. Use Process Builder to add an activity that references the custom method to abusiness process.

EMC Documentum Process Builder Version 6.5 Development Guide 17

Developing Custom Activities

See the Documentum Process Builder User Guide for information about creatingactivities and business processes.

Writing the Java classIn order for the Java Method Server to run an automatic activity, the Java class mustextend the WorkflowMethod class. The Java Method Server invokes the doTask( )method when it runs the activity, passing three arguments:

• The work item associated with the activity• An IDfProperties data structure containing any custom parameters specified in the

activity template for the activity• A pointer to the PrintWriter representing the log fileA typical workflow method performs these major steps:

1. Create a session and connect to the repository.

2. Acquire the work item associated with the activity.

3. Perform the work of the activity.

4. Complete the work item.

5. Release the session.

The WorkflowMethod class takes care of the housekeeping tasks (involving the sessionand the work item), enabling you to focus on step 3 in the doTask( ) method.

Performing the work of an activity usually involves some combination of these tasks:

• Retrieve the values of the custom activity parameters, which are passed to themethod in an IDfProperties data structure

• Retrieve data or content from the package being routed through the workflow• Make calls to external systems using HTTP, SMTP, or Web Services• Create new content and attach it as a package in the workflowThe sample code below shows a workflow method that mimics the functionality ofthe standard XSL Transformation activity template. The method retrieves an XMLdocument from the workflow package, applies a specified XSL file to it, and saves thetransformed content as another workflow package. The code below shows the doTask( )method and calls out the key steps. (See Sample code, page 22 for the complete code ofthe sample class.)

18 EMC Documentum Process Builder Version 6.5 Development Guide

Developing Custom Activities

Figure 1. Sample Workow Java Method

public int doTask(IDfWorkItem workitem, IDfProperties activityParameters,PrintWriter printWriter) throws Exception{

/*Read the activity parameters */1 String requestPackage =

activityParameters.getString(REQUEST_PACKAGE);String outputPackage =activityParameters.getString(OUTPUT_PACKAGE);

String extension =activityParameters.getString(OUTPUT_FILE_EXTENSION);

IDfId xslDocID = activityParameters.getID(XSL_FILE_ID);

File xsl = null;File xml = null;File result = null;

try {/* Read the content of the XML and XSL files */

2 xml = getContent(requestPackage);3 xsl = OperationsHelper.exportDocument(workitem.getsession().xslDocId);result = File.createTempFile("xslresults", "." +

(extension != null ? extension: "xml"));

/* Invoke the XSL Tranformer to create new content */4 transform(new FileReader(xsl), new FileReader(xml),

new FileReader(result));

/*Attach the newly created content to the workflow */5 if (outputPackage != null)

setContent(outputPackage, result, null);

/* Updating process variables, i.e sdt. For more info on IDfWorkitemEx,refer to java doc corresponding to com.documentum.bpm.IDfWorkitemEx*/

if (workitem instanceof IDfWorkitemEx) {IDfWorkitemEx workitemEx = (IDfWorkitemEx) workitem;

Object var0 = workitemEx.getPrimitiveVariableValue("Var0");//Some useful operation with var0workitemEx.setPrimitiveObjectValue("Var0", var0);

6 return 0;}

7 finally {if (xsl != null)

xsl.delete();if (result != null)

result.delete();}

}

The key steps in this sample method are:

1. Retrieve the custom parameter values from the activity.

EMC Documentum Process Builder Version 6.5 Development Guide 19

Developing Custom Activities

An activity template represents a particular type of task that you can add to abusiness process, which typically means an automatic activity running a specificJava workflow method. The activity template definition includes an XML file thatdefines custom attributes for activities created from the template. The XML definesthe names, data types, and display characteristics of the custom attributes. Whenan activity is created from the template, the Activity Inspector in Process Builderincludes one or more extra tabs for the user to use when entering values for thecustom attributes. The values can be fixed constants or variables that are replacedat runtime with values from the current environment, such as the name of theworkflow or the task performer.

The Java method can access the values of the custom attributes and use them in itsprocessing. The activityParameters IDfProperties data structure includes name/valuepairs corresponding to the parameters on the custom tab of the activity. For thissample, the custom parameters are:

Argument Value

REQUEST_PACKAGE Name of the workflow packagecontaining the XML content totransform

OUTPUT_PACKAGE Name of the workflow package intowhich the method puts the transformedcontent

OUTPUT_FILE_EXTENSION File extension for the transformedcontent file. Valid extensions are "xml"and "html"; the extension specifieswhether the transformed content file isan XML file or an HTML file.

XSL_FILE_ID Object ID (from the Documentumrepository) of the XSL file to apply

See Sample code, page 22 for the initWorkflowParams( ) code.

2. Retrieve the XML file from the specified workflow package.

The getContent( ) method returns the content of the package.

3. Retrieve the XSL file from the Documentum repository.

The XSL_FILE_ID parameter provides the object ID of the XSL file. In this sample,the argument to the exportDocument( ) method establishes a session with therepository and retrieves the file. Refer to the Documentum Foundation Classes(DFC) Javadocs for details about the getSession( ) and exportDocument( ) functions.

4. Apply the XSL file to the XML file.

Refer to Sample code, page 22 for the transform( ) method code.

20 EMC Documentum Process Builder Version 6.5 Development Guide

Developing Custom Activities

5. Add the transformed content as a workflow package.

The setContent( ) method sets the content of the specified package (outputPackage)to the specified file (result).

6. Complete the work item.

When you are done processing the work item, call the complete( ) method on thework item object. This method sets the work item status; when control returns tothe workflow engine, the engine checks for complete status before forwarding thework item to the next activity.

7. Return the value zero to indicate success.

8. Clean up the temporary files.

To ensure that the files are removed, put the code that deletes them in a finally clause.

Creating a method objectThis section describes how to create a Documentum method object for a workflowmethod using Documentum Composer. See the Documentum Composer User Guide fordetails about using Documentum Composer.

You can also create a method object using Documentum Administrator, the ContentServer API methods, or DQL statements; see the Documentum Content ServerAdministration Guide for information.

To create a method object for a custom workow method:1. Launch Documentum Composer.

The Documentum Composer User Guide provides details on launching the application.

2. Create a new Documentum project or open an existing Documentum project.The Documentum Composer User Guide provides details on creating and openingprojects.

3. In your Documentum project, expand the Artifacts folder and right-clickMethods.

4. Select New > Other

5. Double-click the Documentum Artifact folder to expand it, then selectMethod.

6. Click Next.The New Documentum Artifact - Name and Location dialog appears.

7. Enter a name for the method.

EMC Documentum Process Builder Version 6.5 Development Guide 21

Developing Custom Activities

The method name appears in Process Builder when you associate the method withan activity. Do not use the format dm_methodname to name the method. This namingconvention is reserved for default Documentum objects.

8. Select Java as the method Type.

9. Enter the fully-qualified class name of the Java class in the Command box.For example:com.documentum.bpm.bpsintegration.bps.DmBPSHTTPIntegration

10. Select these three checkboxes to specify that the method is a workflow method torun on the Java Method Server:• Run as the server• Use method server• Use as workflow methodLeave the other checkboxes unselected.

11. Install the Documentum project into the repository containing the process templatethat will use the method object.The Documentum Composer User Guide provides details on installing Documentumprojects.

12. Save your changes.

Sample codeFigure 2. XsltTransformationActivity Workow Class

public final class XsltTransformationActivity extends WorkflowMethod{public int doTask(IDfWorkItem workitem, IDfProperties activityParameters,

PrintWriter printWriter) throws Exception{

/*Read the activity parameters */String requestPackage =activityParameters.getString(REQUEST_PACKAGE);

String outputPackage =activityParameters.getString(OUTPUT_PACKAGE);

String extension =activityParameters.getString(OUTPUT_FILE_EXTENSION);

IDfId xslDocID = activityParameters.getID(XSL_FILE_ID);

File xsl = null;File xml = null;File result = null;

try {

22 EMC Documentum Process Builder Version 6.5 Development Guide

Developing Custom Activities

/* Read the content of the XML and XSL files */xml = getContent(requestPackage);xsl = OperationsHelper.exportDocument(workitem.getsession().xslDocId);result = File.createTempFile("xslresults", "." +(extension != null ? extension: "xml"));

/* Invoke the XSL Tranformer to create new content */transform(new FileReader(xsl), new FileReader(xml),new FileReader(result));

/*Attach the newly created content to the workflow */if (outputPackage != null)setContent(outputPackage, result, null);

return 0;}finally {if (xsl != null)

xsl.delete();if (result != null)

result.delete();}

}

private static void transform(Reader xsl, Reader xml, Writer result)throws IOException, TransformerException

{assert xsl != null;assert xml != null;assert result != null;

try {TransformerFactory transformerFactory = TransformerFactory.newInstance();Transformer transformer =

transformerFactory.newTransformer(new StreamSource(xsl));transformer.transform(new StreamSource(xml),new StreamResult(result));}

finally {result.close();xsl.close();xml.close();

}}

private static final String REQUEST_PACKAGE = "REQUEST_PACKAGE";private static final String OUTPUT_PACKAGE = "OUTPUT_PACKAGE";private static final String OUTPUT_FILE_EXTENSION ="OUTPUT_FILE_EXTENSION";private static final String XSL_FILE_ID = "XSL_FILE_ID";

}

EMC Documentum Process Builder Version 6.5 Development Guide 23

Developing Custom Activities

24 EMC Documentum Process Builder Version 6.5 Development Guide

Chapter 3Activity template denition le schema

The Activity Template Inspector includes a tab labeled Definition, which you use todefine custom parameters for activities created with the template. The parameters aredefined using XML. The activity template definition XML defines the names, data types,and display characteristics of the custom parameters, as well as any assistance for usersentering values for the parameters. When an activity is created from the template, theActivity Inspector includes one or more extra tabs for the user to use when enteringvalues for the custom parameters. The names of the extra tabs are specified in theactivity template definition file.

In addition to defining extra tabs, the activity template definition file can suppress thedisplay of one or more of the standard Activity Inspector tabs. When an activity iscreated from the template, the Activity Inspector does not display any of the suppressedtabs, thereby preventing the user from changing any of the values on that tab. The valuesset in the Activity Template Inspector remain unchanged.

The structure of an activity template XML file is defined by the schema fileactivity.xsd, which is located on the local file system in the directory ProgramFiles\Documentum\bpm\classes. This section describes the valid XML elements for anactivity template definition file. For a sample activity template XML file, see the SampleActivity Template installed on the Sample activity template palette.

For more information about creating and managing activity templates, see the ProcessBuilder User Guide.

EMC Documentum Process Builder Version 6.5 Development Guide 25

<activity>

<activity>

Purpose Top-level element for an activity template schema

Attributes

Table 2. <activity> Element attributes

Attribute Description

xmlns XML namespace declaration

noNamespaceSchemaLocation Name of the schema file for activitytemplate definitions

Children

<version>

<activity_inspector_configuration>

<resources>

Parents

None

Usage notes

The <activity> element is the top-level element of an activity template definition file. The<activity> element appears automatically on the Definition tab in the Activity TemplateInspector; you need not and should not edit it or its attributes.

The <activity> element has three child elements, representing the major sections of thefile:

26 EMC Documentum Process Builder Version 6.5 Development Guide

<activity>

• The <version> element identifies the version number of the template. The versionnumber typically matches the version of the repository in which the template wascreated.

• The <activity_inspector_configuration> element identifies the custom parameters foractivities based on this activity template and defines their display characteristics.

• The <resources> element lists the string resources used to provide localized labelsfor the user interface controls in the Activity Inspector.

EMC Documentum Process Builder Version 6.5 Development Guide 27

<activity_inspector_conguration>

<activity_inspector_conguration>

Purpose Identifies the custom parameters for the activity template and sets their displaycharacteristics

Children

<parameters>

<display_config>

Parents

<activity>

Usage notes

An activity template definition file must include one <activity_inspector_configuration>element. It usually appears immediately after the <version> element. The<activity_inspector_configuration> element is divided into two parts:

• The <parameters> element defines the custom parameters for this activity template,along with their data types, default values, and validation rules.

• The <display_config> element defines the user interface elements used to display thecustom parameters in the Activity Inspector.

28 EMC Documentum Process Builder Version 6.5 Development Guide

<char-length>

<char-length>

Purpose Sets the minimum and maximum length for a string value

Children

<minLength>

<maxLength>

Parents

<rules>

Usage notes

The optional <char-length> element is valid only for parameters whose data type isstring. It sets a data-validation rule based on the length of the string. The number ofcharacters in the string must fall in the range given by the child elements <minLength>and <maxLength>, inclusive. If the user enters a string whose length does not fall withinthis range, the Activity Inspector displays an error when the user attempts to save theactivity.

EMC Documentum Process Builder Version 6.5 Development Guide 29

<chooser-dialog>

<chooser-dialog>

Purpose Specifies whether to offer the user a dialog box for entering substitution variablesinto a string parameter value

Children

None

Parents

<parameter_display>

Usage notes

When entering values into the data entry fields on a custom tab in the Activity Inspector,a user can include variables that are replaced at runtime with values from the currentenvironment, such as the name of the workflow or the task performer. The variable canbe the complete value of the field, or it can appear anywhere within a longer string thatcontains literal text, other substitution variables, or both.

The <chooser-dialog> element provides a dialog box from which the user can selecta substitution variable rather than typing it into the field. When the <chooser-dialog>element appears with the string true between its opening and closing tags, the ActivityInspector displays an ellipsis (...) button next to the data entry field for the parameter.The user can click the button to display a selection dialog box.

The <chooser-dialog> element is valid only for parameters whose data type is string. Itis optional; if it does not appear or has a value other than true, the dialog box is notavailable. The user can type in substitution variables, but cannot select them.

Example

Example of <chooser-dialog>

<parameter_display id="WorkflowIDSelect" paramid="WorkflowID"><label nlsid="WORKFLOWID_LABEL"/><chooser-dialog>true</chooser-dialog>

30 EMC Documentum Process Builder Version 6.5 Development Guide

<chooser-dialog>

</parameter_display>

EMC Documentum Process Builder Version 6.5 Development Guide 31

<display_cong>

<display_cong>

Purpose Defines the user interface controls used to display custom parameters in theActivity Inspector

Children

<parameter_displays>

<tabs>

Parents

<activity_inspector_configuration>

Usage notes

The <display_config> element combines with its sibling <parameters> element to definethe custom parameters for the activity template. The <parameters> element definesthe data to be collected (such as its data type, default value, and validation rules), andthe <display_config> element defines the user interface used to display the data-entrycontrols in the Activity Inspector.

The <display_config> element also controls which tabs the Activity Inspector displays tothe user and the order in which they appear.

32 EMC Documentum Process Builder Version 6.5 Development Guide

<item>

<item>

Purpose Defines a value to display in a value assistance list

Children

<item_data>

<item_display>

Parents

<list_specification>

Usage notes

Each <item> element defines a single value in a value assistance list. The parent<list_specification> element contains one <item> for each valid value.

The <item_data> child element defines the value that is saved into the parameter whenthe user selects the item. The <item_display> child element defines how the valueappears to the user in the Activity Inspector, both in the list and in the data entry fieldwhen the user selects the item.

EMC Documentum Process Builder Version 6.5 Development Guide 33

<item_data>

<item_data>

Purpose Defines the value saved into a parameter when a user selects the parent <item>from a value assistance list

Children

None

Parents

<item>

Usage notes

Each <item> element defines a single value in a value assistance list. The <item_data>child element defines the value that is saved into the parameter when the user selectsthe item. The <item_display> child element defines how the value appears to the user inthe Activity Inspector, both in the list and in the data entry field when the user selectsthe item.

34 EMC Documentum Process Builder Version 6.5 Development Guide

<item_display>

<item_display>

Purpose Sets how an item in a value assistance list appears in the Activity Inspector

Children

None

Parents

<item>

Usage notes

Each <item> element defines a single value in a value assistance list. The <item_data>child element defines the value that is saved into the parameter when the user selectsthe item. The <item_display> child element defines how the value appears to the user inthe Activity Inspector, both in the list and in the data entry field when the user selectsthe item.

EMC Documentum Process Builder Version 6.5 Development Guide 35

<label>

<label>

Purpose Identifies the <nlsid> element that provides a label for a user interface control

Attributes

Table 3. <label> Element attributes

Attribute Description

nlsid Name of the <nlsid> element that providesthe strings for this user interface control

Children

None

Parents

<parameter_display>

<tab>

Usage notes

The <label> element provides the label for its parent user interface control (a<parameter_display> or a <tab>). The label is not a literal string but rather than name ofan <nlsid> element that contains a collection of equivalent strings for multiple languages.At runtime, Process Builder chooses which string to display as the label based on theuser’s preferred language.

36 EMC Documentum Process Builder Version 6.5 Development Guide

<list_specication>

<list_specication>

Purpose Defines a list of valid values from which the user can choose

Attributes

Table 4. <list_specication> Element attributes

Attribute Description

multi-select Optional attribute specifying whether theuser can select more than one value fromthe list. Valid values are "true" and "false";the default is "false".

Children

<item>

Parents

<value_assistance>

Usage notes

Among the validation rules available for parameters is value assistance. Valueassistance provides users with a list of valid values to choose from instead of afree-form data entry field. The valid values can come from one of three sources: arepository query (<query_specification>), the list of defined packages for the process(<package_specification>), or a fixed list of predefined values (<list_specification>).

The <list_specification> element contains one or more <item> elements, each of whichdefines one value that appears in the value assistance list. The values appear in adrop-down list, with the selected value or values in the text box.

When the multi-select attribute is set to true, the Activity Inspector displays and ellipsis(...) button next to the field, along with a Clear button for resetting the field value. The

EMC Documentum Process Builder Version 6.5 Development Guide 37

<list_specication>

user can select items from the list by clicking the ellipsis button to display a selectiondialog box. When the user clicks OK to close the dialog box, the selected items appear inthe data field. If multiple items are selected, the field shows the text "Multiple items:"followed by the first item. The items are saved (without the "Multiple items:" text) ina comma-separated list.

When the multi-select attribute does not appear or is set to false, the Activity Inspectordisplays the available items in a drop-down list.

38 EMC Documentum Process Builder Version 6.5 Development Guide

<locale>

<locale>

Purpose Provides a label to use for a specified locale

Attributes

Table 5. <locale> Element attributes

Attribute Description

language String identifying the language and localefor which the enclosed string applies.The format of the language value islang_LOCALE, a concatenation of thelanguage and locale ISO codes.

Children

None

Parents

<nlsid>

Usage notes

Each <nlsid> element represents a single label in the Activity Inspector user interface.Each <locale> child element provides the literal string to use for a particular languageand locale. At runtime, Process Builder chooses which string to display as the label basedon the language chosen when the application was installed.

Refer to the Process Builder Localization Guide for further details about localizing activitytemplates.

EMC Documentum Process Builder Version 6.5 Development Guide 39

<mandatory>

<mandatory>

Purpose Specifies whether a parameter is required or optional

Children

None

Parents

<rules>

Usage notes

By default, all custom parameters are required. If the user does not enter a value fora parameter, the Activity Inspector displays an error when the user tries to save theactivity. To make a parameter optional, include the <mandatory> element with falsebetween its opening and closing tags. The <mandatory> element itself is optional.

40 EMC Documentum Process Builder Version 6.5 Development Guide

<maxInclusive>

<maxInclusive>

Purpose Sets the maximum valid value for a numeric parameter

Attributes

Table 6. <minInclusive> Element attributes

Attribute Description

value Integer specifying the maximum value forthe parent <parameter> element.

Children

None

Parents

<range>

Usage notes

The <range> element sets the range of valid values for a parameter whose data type isinteger or float. The user must enter a value within the range specified in the childelements <minInclusive> and <maxInclusive>.

EMC Documentum Process Builder Version 6.5 Development Guide 41

<maxLength>

<maxLength>

Purpose Specifies the maximum length of a character parameter

Attributes

Table 7. <maxLength> Element attributes

Attribute Description

value Integer specifying the maximum lengthof the value for the parent <parameter>element.

Children

None

Parents

<char-length>

Usage notes

The optional <char-length> element is valid only for parameters whose data type isstring. It sets a data-validation rule based on the length of the string. The number ofcharacters in the string must fall in the range given by the child elements <minLength>and <maxLength>, inclusive. If the user enters a string whose length does not fall withinthis range, the Activity Inspector displays an error when the user attempts to save theactivity.

42 EMC Documentum Process Builder Version 6.5 Development Guide

<minInclusive>

<minInclusive>

Purpose Sets the minimum valid value for a numeric parameter

Attributes

Table 8. <minInclusive> Element attributes

Attribute Description

value Integer specifying the minimum value forthe parent <parameter> element.

Children

None

Parents

<range>

Usage notes

The <range> element sets the range of valid values for a parameter whose data type isinteger or float. The user must enter a value within the range specified in the childelements <minInclusive> and <maxInclusive>.

EMC Documentum Process Builder Version 6.5 Development Guide 43

<minLength>

<minLength>

Purpose Specifies the minimum length of a character parameter

Attributes

Table 9. <minLength> Element attributes

Attribute Description

value Integer specifying the minimum lengthof the value for the parent <parameter>element.

Children

None

Parents

<char-length>

Usage notes

The optional <char-length> element is valid only for parameters whose data type isstring. It sets a data-validation rule based on the length of the string. The number ofcharacters in the string must fall in the range given by the child elements <minLength>and <maxLength>, inclusive. If the user enters a string whose length does not fall withinthis range, the Activity Inspector displays an error when the user attempts to save theactivity.

44 EMC Documentum Process Builder Version 6.5 Development Guide

<multi-line>

<multi-line>

Purpose Specifies the maximum length of a parameter whose data type is character

Children

None

Parents

<rules>

Usage notes

The optional <multi-line> element is valid only for parameters whose data type is string.It specifies whether the parameter value can include new line characters. If the elementdoes not appear, or if it has any value other than true between its opening and closingtags, the user can enter only a single-line value.

EMC Documentum Process Builder Version 6.5 Development Guide 45

<nlsid>

<nlsid>

Purpose Provides the localized labels for displaying a custom parameter in the ActivityInspector

Attributes

Table 10. <nlsid> Element attributes

Attribute Description

id Unique name for the collection of strings

Children

<locale>

Parents

<strings>

Usage notes

Each <nlsid> element represents a single label in the Activity Inspector user interface.Each <locale> child element provides the literal string to use for a particular languageand locale. At runtime, Process Builder chooses which string to display as the label basedon the language chosen when the application was installed.

Refer to the Process Builder Localization Guide for further details about localizing activitytemplates.

46 EMC Documentum Process Builder Version 6.5 Development Guide

<query>

<query>

Purpose Defines the query for populating a value assistance list

Children

None

Parents

<query_data>

Usage notes

The <query> element is the part of a <query_specification> element that defines theactual query. The data that the query selects from the Documentum repository mustinclude both the data that will be saved as the parameter value (identified by the siblingelement <query_column>) and the data that will be displayed in the Activity Inspector(identified by the <query_display> element).

Example

In this sample taken from the Sample Activity Template, the query selects a list of objects.For each object it retrieves the object ID and name. The Activity Inspector displays theobject_name in the value assistance list, as indicated by the <query_column> elementthat appears inside of the <query_display> element. The user selects an object by name,but Process Builder saves the r_object_id of the selected object, as indicated by the<query_column> element inside of the <query_data> element.

Example of <query>

<query_specification><query_data>

<query>select r_object_id, object_name from dm_method</query><query_column>r_object_id</query_column>

</query_data><query_display>

EMC Documentum Process Builder Version 6.5 Development Guide 47

<query>

<query_column>object_name</query_column></query_display>

</query_specification>

48 EMC Documentum Process Builder Version 6.5 Development Guide

<query_column>

<query_column>

Purpose Specifies which data from the query result set is saved as the parameter valueor displayed in the value assistance list

Children

None

Parents

<query_data>

<query_display>

Usage notes

The <query_column> element appears in two contexts within a <query_specification>element.

First, it appears in the <query_data> element as a sibling to the <query> itself. In thiscontext, the <query_column> identifies which of the columns returned by the <query>contains the value to save as the parameter value.

Second, it appears in the <query_display> element. In this context, the <query_column>identifies which of the columns returned by the <query> contains the values to display inthe value assistance list in the Activity Inspector.

Example

In this sample taken from the Sample Activity Template, the query selects a list of objects.For each object it retrieves the object ID and name. The Activity Inspector displays theobject_name in the value assistance list, as indicated by the <query_column> elementthat appears inside of the <query_display> element. The user selects an object by name,but Process Builder saves the r_object_id of the selected object, as indicated by the<query_column> element inside of the <query_data> element.

EMC Documentum Process Builder Version 6.5 Development Guide 49

<query_column>

Example of <query_column>

<query_specification><query_data>

<query>select r_object_id, object_name from dm_method</query><query_column>r_object_id</query_column>

</query_data><query_display>

<query_column>object_name</query_column></query_display>

</query_specification>

50 EMC Documentum Process Builder Version 6.5 Development Guide

<query_data>

<query_data>

Purpose Defines the query used to retrieve data for populating a parameter’s valueassistance list

Children

<query>

<query_column>

Parents

<query_specification>

Usage notes

The <query_data> element defines the query used to populate a value assistance list. The<query> child element is the query, and the <query_column> child element identifieswhich of the columns in the query result set contains the value to save as the parametervalue.

Example

In this sample taken from the Sample Activity Template, the query selects a list of objects.For each object it retrieves the object ID and name. The Activity Inspector displays theobject_name in the value assistance list, as indicated by the <query_column> elementthat appears inside of the <query_display> element. The user selects an object by name,but Process Builder saves the r_object_id of the selected object, as indicated by the<query_column> element inside of the <query_data> element.

Example of <query_data>

<query_specification><query_data>

<query>select r_object_id, object_name from dm_method</query><query_column>r_object_id</query_column>

</query_data>

EMC Documentum Process Builder Version 6.5 Development Guide 51

<query_data>

<query_display><query_column>object_name</query_column>

</query_display></query_specification>

52 EMC Documentum Process Builder Version 6.5 Development Guide

<query_display>

<query_display>

Purpose Specifies which column in a query result set is used to populate a value assistancelist

Children

<query_column>

Parents

<query_specification>

Usage notes

The <query_display> element identifies which column from the query result set to displayas the values in the value assistance list in the Activity Inspector. The column mustmatch one of the columns in the <query> element within the same <query_specification>.

Example

In this sample taken from the Sample Activity Template, the query selects a list of objects.For each object it retrieves the object ID and name. The Activity Inspector displays theobject_name in the value assistance list, as indicated by the <query_column> elementthat appears inside of the <query_display> element. The user selects an object by name,but Process Builder saves the r_object_id of the selected object, as indicated by the<query_column> element inside of the <query_data> element.

Example of <query_display>

<query_specification><query_data>

<query>select r_object_id, object_name from dm_method</query><query_column>r_object_id</query_column>

</query_data><query_display>

<query_column>object_name</query_column></query_display>

EMC Documentum Process Builder Version 6.5 Development Guide 53

<query_display>

</query_specification>

54 EMC Documentum Process Builder Version 6.5 Development Guide

<query_specication>

<query_specication>

Purpose Defines a query for populating a parameter’s value assistance list

Attributes

Table 11. <query_specication> Element attributes

Attribute Description

multi-select Optional attribute specifying whether theuser can select more than one value fromthe query results. Valid values are "true"and "false"; the default is "false".

Children

<query_data>

<query_display>

Parents

<value_assistance>

Usage notes

Among the validation rules available for parameters is value assistance. Valueassistance provides users with a list of valid values to choose from instead of afree-form data entry field. The valid values can come from one of three sources: arepository query (<query_specification>), the list of defined packages for the process(<package_specification>), or a fixed list of predefined values (<list_specification>).

The <query_specification> element consists of two child elements: <query_data>, whichdefines the query and the data it returns, and <query_display>, which specifies how thedata is displayed in the Activity Inspector.

EMC Documentum Process Builder Version 6.5 Development Guide 55

<query_specication>

When the multi-select attribute is set to true, the Activity Inspector displays and ellipsis(...) button next to the field, along with a Clear button for resetting the field value. Theuser can select items from the list by clicking the ellipsis button to display a selectiondialog box. When the user clicks OK to close the dialog box, the selected items appear inthe data field. If multiple items are selected, the field shows the text "Multiple items:"followed by the first item. The items are saved (without the "Multiple items:" text) ina comma-separated list.

When the multi-select attribute does not appear or is set to false, the Activity Inspectordisplays the available items in a drop-down list.

Example

In this sample taken from the Sample Activity Template, the query selects a list of objects.For each object it retrieves the object ID and name. The Activity Inspector displays theobject_name in the value assistance list, as indicated by the <query_column> elementthat appears inside of the <query_display> element. The user selects an object by name,but Process Builder saves the r_object_id of the selected object, as indicated by the<query_column> element inside of the <query_data> element.

Example of <query_specication>

<query_specification><query_data>

<query>select r_object_id, object_name from dm_method</query><query_column>r_object_id</query_column>

</query_data><query_display>

<query_column>object_name</query_column></query_display>

</query_specification>

56 EMC Documentum Process Builder Version 6.5 Development Guide

<package_specication>

<package_specication>

Purpose Displays a list of the defined packages for this process as the valid values fora parameter

Attributes

Table 12. <package_specication> Element attributes

Attribute Description

multi-select Optional attribute specifying whether theuser can select more than one package.Valid values are "true" and "false"; thedefault is "false".

Children

None

Parents

<value_assistance>

Usage notes

When the <value_assistance> for a parameter is a <package_specification> element, thevalue assistance list contains the names of all packages defined for the process.

When the multi-select attribute is set to true, the Activity Inspector displays and ellipsis(...) button next to the field, along with a Clear button for resetting the field value. Theuser can select packages from the list by clicking the ellipsis button to display a selectiondialog box. When the user clicks OK to close the dialog box, the selected packagesappear in the data field. If multiple packages are selected, the field shows the text"Multiple items:" followed by the first package. The package list is saved (without the"Multiple items:" text) in a comma-separated list.

EMC Documentum Process Builder Version 6.5 Development Guide 57

<package_specication>

When the multi-select attribute does not appear or is set to false, the Activity Inspectordisplays the available packages in a drop-down list.

58 EMC Documentum Process Builder Version 6.5 Development Guide

<parameter>

<parameter>

Purpose Defines a custom parameter for the activity template, including its data type,default value, and validation rules

Attributes

Table 13. <parameter> Element attributes

Attribute Description

datatype Data type of the parameter value. Thevalid types are string, id, integer, float,time, and boolean.

id Unique name of the parameter, usedto link the <parameter> element to itsmatching <parameter_display> element.

Children

<value>

<rules>

Parents

<parameters>

Usage notes

The <parameter> element specifies the data type, default value, and validation rules for acustom parameter. The data type of the value is specified with the datatype attribute.The <value> child element provides the default value, and the <rules> child elementdefines the validation rules; both elements are optional.

EMC Documentum Process Builder Version 6.5 Development Guide 59

<parameter>

The type of user interface control that appears in the Activity Inspector for thisparameter is determined by the data type. The label is set by the corresponding<parameter_display> element.

60 EMC Documentum Process Builder Version 6.5 Development Guide

<parameter_display>

<parameter_display>

Purpose Defines how a parameter appears in the Activity Inspector

Attributes

Table 14. <parameter_display> Element attributes

Attribute Description

id Unique name for the user interface controlused to display the custom parameter;used inside a <tab> element to specifywhich tab it appears on in the ActivityInspector

paramid id value for the <parameter> elementto which this user interface controlcorresponds

Children

<label>

<chooser-dialog>

Parents

<parameter_displays>

Usage notes

The activity template definition file must contain a <parameter_display> elementcorresponding to each <parameter> element that requires user interaction. The paramidattribute identifies which <parameter> element the <parameter_display> applies to. Ifno <parameter_display> elements refer to a given <parameter>, that parameter does notappear in the Activity Inspector.

EMC Documentum Process Builder Version 6.5 Development Guide 61

<parameter_display>

In turn, each <parameter_display> element has a corresponding <parameter_display_id>element that determines which tab the user interface control appears on in the ActivityInspector. If no <parameter_display_id> element refers to a given <parameter_display>,the parameter does not appear in the Activity Inspector.

The <label> child element identifies the label used for the parameter display. The type ofuser interface control depends on the data type of the parameter.

The <chooser-dialog> element, which provides a dialog box for selecting substitutionvariables, is valid only for parameters whose data type is string.

62 EMC Documentum Process Builder Version 6.5 Development Guide

<parameter_display_id>

<parameter_display_id>

Purpose Identifies a user interface control to display on a tab

Attributes

Table 15. <parameter_display_id> Element attributes

Attribute Description

separator Set to "true" to display a separation lineon a tab

Children

None

Parents

<tab>

Usage notes

A <parameter_display_id> element identifies a user interface control to display in theActivity Inspector on the tab represented by the parent <tab> element. The content thatappears between the opening and closing tags of the <parameter_display_id> element isthe ID of a <parameter_display> element.

To display a line that visually separates the parameters on a tab, set the separatorattribute to true and do not include any content between the opening and closing tags.See the example for the <tab> element for an example.

EMC Documentum Process Builder Version 6.5 Development Guide 63

<parameter_displays>

<parameter_displays>

Purpose Defines the user interface elements used to display custom parameters in theActivity Inspector

Children

<parameter_display>

Parents

<display_config>

Usage notes

The <parameter_displays> element encloses all of the individual <parameter_display>elements. The activity template definition file must contain only one<parameter_displays> element.

64 EMC Documentum Process Builder Version 6.5 Development Guide

<parameters>

<parameters>

Purpose Defines the custom parameters for the activity template, including their data types,default values, and validation rules

Children

<parameter>

Parents

<activity_inspector_configuration>

Usage notes

The <parameters> element encloses all of the individual <parameter> elements. Theactivity template definition file must contain only one <parameters> element.

EMC Documentum Process Builder Version 6.5 Development Guide 65

<password>

<password>

Purpose Instructs the Activity Inspector to display asterisks as the user enters charactersinto a string field

Children

None

Parents

<rules>

Usage notes

The optional <password> element changes a string parameter so that the ActivityInspector does not display individual characters as a user types them into the field.Instead, it displays an asterisk in place of each character. However, the actually enteredcharacters are saved as the value of the parameter.

66 EMC Documentum Process Builder Version 6.5 Development Guide

<range>

<range>

Purpose Sets the range of valid values for a numeric parameter

Children

<minInclusive>

<maxInclusive>

Parents

<rules>

Usage notes

The <range> element sets the range of valid values for a parameter whose data type isinteger or float. The user must enter a value within the range specified in the childelements <minInclusive> and <maxInclusive>.

EMC Documentum Process Builder Version 6.5 Development Guide 67

<resources>

<resources>

Purpose Lists the string resources used to provide localized labels for displaying theparameters in the Activity Inspector

Children

<strings>

Parents

<activity>

Usage notes

The <resources> element provides the user interface strings used to display data-entrycontrols for the custom parameters in the Activity Inspector. Each <parameter_display>element, which determines how a control appears in the Activity Inspector, includes a<label> element. Rather than containing literal text, the <label> element refers to an<nlsid> element that contains a separate literal text string for each possible locale. Whenthe Activity Inspector appears, it displays the string appropriate to the language inwhich Process Builder was installed.

68 EMC Documentum Process Builder Version 6.5 Development Guide

<rules>

<rules>

Purpose Defines the validation rules for a custom parameter

Children

<char-length>

<mandatory>

<value_assistance>

<password>

<multi-line>

<range>

Parents

<parameter>

Usage notes

The <rules> element defines the validation rules for a custom parameter. The variouschild elements each represent a particular type of rule. All of the child elements areoptional, and some of them are valid only for parameters of a particular data type:

• <char-length>, <password>, and <multi-line> are valid only for string parameters• <range> is valid only for numeric parameters (integer and float)

EMC Documentum Process Builder Version 6.5 Development Guide 69

<strings>

<strings>

Purpose Lists the string resources used to provide localized labels for displaying theparameters in the Activity Inspector

Children

<nlsid>

Parents

<resources>

Usage notes

The <strings> element encloses the individual user interface strings used to displaydata-entry controls for the custom parameters in the Activity Inspector. Each<parameter_display> element, which determines how a control appears in the ActivityInspector, includes a <label> element. Rather than containing literal text, the <label>element refers to an <nlsid> element that contains a separate literal text string for eachpossible locale. When the Activity Inspector appears, it displays the string appropriateto the language in which Process Builder was installed.

70 EMC Documentum Process Builder Version 6.5 Development Guide

<tab>

<tab>

Purpose Specifies which custom controls appear on a custom tab or whether the ActivityInspector displays one of the standard tabs

Attributes

Table 16. <tab> Element attributes

Attribute Description

id Unique name for a custom tab, orthe name of one of the standardtabs.The names of the standard tabs arePROPERTIES, PERFORMER, TRIGGER,NOTIFICATION, TRANSITION,PACKAGE, and DISPLAY.

order Optional parameter specifying whether acustom tab should appear "first" or "last"in the order of tabs.

showInActInspector "true" or "false", specifying whetherone of the standard tabs appears in theActivity Inspector for activities based onthis activity template. This parameter isignored for custom tabs.

Children

<label>

<parameter_display_id>

Parents

<tabs>

EMC Documentum Process Builder Version 6.5 Development Guide 71

<tab>

Usage notes

The <tab> element works differently depending on whether the id attribute refers to acustom tab or to one of the standard Activity Inspector tabs.

For a custom tab, the <tab> element contains a <label> child element, which provides thename that appears on the tab, and one or more <parameter_display_id> child elements,which identify the user interface controls to appear on the tab. An activity templatecan have multiple custom tabs.

When the id attribute refers to one of the standard Activity Inspector tabs, the<tab> element does not contain child elements. Instead, the tag includes theshowInActInspector attribute to specify whether the standard tab appears in activitiesbased on this template. Certain of the standard tabs may not be relevant for certainactivities, or the activity template may have preset values on the tabs that users shouldnot be able to modify.

Example

This example illustrates an activity template that includes a custom tab and suppressesthe standard Performer and Notification tabs. When a user creates an activity based onthis template, he or she will not be able to modify any values on the Performer andNotification tabs.

Example of <tab>

<tabs><tab id="custom" order="last">

<label nlsid="CUSTOM_TAB_LABEL"/><parameter_display_id>myString</parameter_display_id><parameter_display_id>myNumber</parameter_display_id><parameter_display_id separator="true"/><parameter_display_id>myBoolean</parameter_display_id><parameter_display_id separator="true"/><parameter_display_id>myObjectId</parameter_display_id><parameter_display_id>myPackage</parameter_display_id>

</tab><tab id="PERFORMER" showInActInspector="false"/><tab id="NOTIFICATION" showInActInspector="false"/>

</tabs>

72 EMC Documentum Process Builder Version 6.5 Development Guide

<tabs>

<tabs>

Purpose Identifies the tabs that appear in the Activity Inspector

Children

<tab>

Parents

<display_config>

Usage notes

The <tabs> element encloses all of the individual <tab> elements. The activity templatedefinition file must contain only one <tabs> element.

EMC Documentum Process Builder Version 6.5 Development Guide 73

<value>

<value>

Purpose Provides the default value for a custom parameter

Children

None

Parents

<parameter>

Usage notes

The optional <value> element provides the default value for a parameter. The valueappears in the Activity Inspector when the activity is first created. The value shouldbe enclosed as CDATA.

74 EMC Documentum Process Builder Version 6.5 Development Guide

<value_assistance>

<value_assistance>

Purpose Provides a list of values from which the user can choose

Children

<query_specification>

<list_specification>

<package_specification>

Parents

<rules>

Usage notes

Among the validation rules available for parameters is value assistance. Valueassistance provides users with a list of valid values to choose from instead of afree-form data entry field. The valid values can come from one of three sources: arepository query (<query_specification>), the list of defined packages for the process(<package_specification>), or a fixed list of predefined values (<list_specification>).

EMC Documentum Process Builder Version 6.5 Development Guide 75

<version>

<version>

Purpose Specifies the version number of the repository in which the activity template wascreated

Children

None

Parents

<activity>

Usage notes

The optional <version> parameter specifies the version of the activity template definitionfile. The value between the opening and closing tags is typically the version number ofthe repository in which the activity template was created.

76 EMC Documentum Process Builder Version 6.5 Development Guide

Index

Aactivities

creating custom, 17retrieving custom parameters, 20template schema, 25writing Java code, 18

activity element (XML), 26activity_inspector_configuration element

(XML), 28

Cchar-length element (XML), 29chooser-dialog element (XML), 30

DDefinition tab (activity templates), 25display_config element (XML), 32

Eemail templates

creating, 10sample content, 13troubleshooting, 14using, 9variables, 11

eventsemail templates for, 9

HHTML

using in notification messages, 10

Iitem element (XML), 33item_data element (XML), 34item_display element (XML), 35

JJava

writing code for custom activities, 18Java Method Server, 18JSP

using in notification messages, 10

Llabel element (XML), 36list_specification element (XML), 37locale element (XML), 39localized labels, 68, 70

Mmandatory element (XML), 40maxInclusive element (XML), 41maxLength element (XML), 42method objects

creating for workflow methods, 21minInclusive element (XML), 43minLength element (XML), 44multi-line element (XML), 45

Nnlsid element (XML), 46

Ppackage_specification element (XML), 57packages

providing a selection list, 57parameter element (XML), 59parameter_display element (XML), 61parameter_display_id element (XML), 63parameter_displays element (XML), 64parameters

providing value assistance, 75retrieving for activities, 20

parameters element (XML), 65

EMC Documentum Process Builder Version 6.5 Development Guide 77

Index

password element (XML), 66

Qquery element (XML), 47query_column element (XML), 49query_data element (XML), 51query_display element (XML), 53query_specification element (XML), 55

Rrange element (XML), 67resources element (XML), 68rules element (XML), 69

Sschema

for activity templates, 25strings element (XML), 70

Ttab element (XML), 71tabs

adding to Activity Inspector, 71

tabs element (XML), 73tasks

creating custom, 17troubleshooting

email notification, 14

Vvalidation rules, 69value element (XML), 74value_assistance element (XML), 75variables

using in notification messages, 11version element (XML), 76

Wworkflow activities, see activitiesworkflow methods

creating method objects, 21WorkflowMethod class, 18

XXML schema for activity templates, 25

78 EMC Documentum Process Builder Version 6.5 Development Guide