Archive

Posts Tagged ‘Package’

Handling Workflows and Tasks in DCTM using DFC

April 26, 2010 Comments off

How can we Start workflows in a docbase using docbase right from getting the attachment document , getting the workflow template , creating a workbuilder to start a workflow ,getting the First Activity,getting the Package Name , Port and Package DocType ,Adding the attachment document to List ,Adding a Package to Workflow Builder and finally how do we view the tasks in INBOX ?

The tried out example below will give you the step by step procedure of starting a workflow in a docbase and viewing tasks in inbox in DCTM using DFC.

Starting workflow in a docbase:

public void startWorkflow() throws Exception {

IDfSysObject sysObj = (IDfSysObject) idfSession. getObjectByQualification(“dm_document where object_name=’Test-Document'”);

IDfProcess process = (IDfProcess) idfSession.getObjectByQualification (“dm_process where object_name=’temp_workflow'”);

IDfWorkflowBuilder builder = idfSession.newWorkflowBuilder(process.getObjectId());

IDfId wfId = builder.initWorkflow();

IDfList startActivityNames = builder.getStartActivityNames();

IDfList startActivities = builder.getStartActivityIds();

String activityName = startActivityNames.getString(0);

IDfId activityID = (IDfId) startActivities.get(0);

IDfActivity activity = (IDfActivity) idfSession.getObject(activityID);

int nPorts = activity.getPortCount();

String InputPortName = null;

String PkgType = null;

String PkgName = null;

for (int j=0; j<nPorts; j++) {

System.out.println( “Port Name: ” + activity.getPortName(j) + “, ” + “Port Type = ” + activity.getPortType(j) );

if (activity.getPortType(j).equals( “INPUT” ) ) {

InputPortName = activity.getPortName(j);

PkgType = activity.getPackageType(j);

PkgName = activity.getPackageName(j);

}
}

IDfList dfList = new DfList();

dfList.append(sysObj.getObjectId());

IDfId wfId2 = builder.runWorkflow();

builder.addPackage(activityName, InputPortName, PkgName, PkgType, null, false, dfList);

System.out.println(“Package added”);

}

Viewing task in inbox:

public void getInbox() throws Exception {

IDfCollection tasks = idfSession.getTasks(“temp”, DfSession.DF_TASKS, “name, date_sent, message “, “task_name”);
try {
while (tasks.next()) {
IDfWorkitem wi = (IDfWorkitem) idfSession.getObject
(tasks.getId(“item_id”));
IDfId queueItemId = wi.getQueueItemId();
IDfQueueItem qi = (IDfQueueItem) idfSession.getObject(queueItemId);
System.out.println(tasks.getString(“sent_by”) +” “+
tasks.getString(“task_name”)+” “+ tasks.getString(“date_sent”)+” “+ tasks.getString(“message”)+” “+ qi.getItemName());
IDfActivity dfActivity=wi.getActivity();
System.out.println(“\tActivity Information : “+dfActivity.getString(“object_name”));
IDfCollection packColl= null;
try {
packColl=wi.getPackages(“”);
while(packColl.next()) {
IDfSysObject sysObj=(IDfSysObject) idfSession.getObject (packColl.getId(“r_component_id”));
System.out.println(“\t Package Information: ” + sysObj.getString(“object_name”));
}

} finally {
if(packColl != null)
packColl.close();
}

// to finish a Task or Workitem
//finishTask(wi);
}

} finally {
if(tasks!=null) tasks.close();
}
}

DFC Programming Approach

April 17, 2010 Comments off

DFC enables programmers to access content management functionality through both high-level operations and low-level object method calls. A services layer encapsulates business logic for common processes, such as workflow, data validation, searching, and virtual document management.

 DFC is organized into a set of Interfaces and Classes.

 • DFC implementation classes will begin with Df

 • Interfaces will begin with IDf


Package Description
com.documentum.com Facilitates accessing DFC from COM
com.documentum.fc.client Provides basic functionality:Establishing DFC sessionsRetrieving and validating data

Managing workflows

Manipulating virtual documents

Working with document versions

common.documentum.fc.client.qb Constructs and run queries and SmartLists.
com.documentum.fc.common Supplies utility methods for other DFC classes.
com.documentum.operations Provides high-level functionality, such as checking documents or virtual documents in and out. Provides XML Support.
com.documentum.registry Maintains Documentum information on the client’s system, using the window registry on win32 platforms, and .ini files otherwise.
com.documentum.xml.xql Facilitates constructing Docbase queries that return results in an XML format.

Categories: DOCUMENTUM Tags: , , ,
%d bloggers like this: