Professional Documents
Culture Documents
Write Java Code To Implement Idfmodule, Idflifecycleuserentrycriteria, Idflifecycleuseraction and Idflifecycleuserpostprocessing, Export As Jar
Write Java Code To Implement Idfmodule, Idflifecycleuserentrycriteria, Idflifecycleuseraction and Idflifecycleuserpostprocessing, Export As Jar
The purpose of this article is to showcase creating custom Java module to be used in Documentum
lifecycle.
The custom Java code don’t do much, except to append some keyword to the document when the
document enters the lifecycle state, in the lifecycle state and post processed in the lifecycle state.
Click to select the project, in this example TestLifecyle, right mouse click, select Build Path – Configure
Build Path.
Click Apply and Close button to close the Properties for TestLifecycle popup window.
Click to select src folder, right mouse click, select New – Class.
Type com.documentum.lifecyle in the Package filed, type TestIDfLifecycleUserEntryCriteria in the Name
field, click Finish button.
Click to select src folder, right mouse click, select New – Class.
Type com.documentum.lifecyle in the Package filed, type TestIDfLifecycleUserEntryCriteria in the Name
field, click Finish button.
Click to select src folder, right mouse click, select New – Class.
Type com.documentum.lifecyle in the Package filed, type TestIDfLifecycleUserEntryCriteria in the Name
field, click Finish button.
TestIDfLifecycleUserEntryCriteria.java
Double click to open IDfLifecycleUserEntryCriteria.java and type in the code, after that click Control-S to
save the code.
package com.documentum.lifecyle;
import com.documentum.fc.client.IDfModule;
import com.documentum.fc.client.IDfSysObject;
import com.documentum.fc.common.DfException;
import com.documentum.fc.common.DfLogger;
import com.documentum.fc.lifecycle.IDfLifecycleUserEntryCriteria;
@Override
public boolean userEntryCriteria(IDfSysObject sysObject,
String userName, String targetState) throws DfException {
try {
sysObject.appendString("keywords", "TestIDfLifecycleUserEntryCriteria");
sysObject.save();
} catch (Exception e) {
} finally {
}
return true;
}
}
IDfLifecycleUserAction.java
Double click to open IDfLifecycleUserAction.java and type in the code, after that click Control-S to save
the code.
package com.documentum.lifecyle;
import com.documentum.fc.client.IDfModule;
import com.documentum.fc.client.IDfSysObject;
import com.documentum.fc.common.DfException;
import com.documentum.fc.common.DfLogger;
import com.documentum.fc.lifecycle.IDfLifecycleUserAction;
@Override
public void userAction(IDfSysObject sysObject, String userName,
String targetState) throws DfException {
try {
sysObject.appendString("keywords", "TestIDfLifecycleUserAction");
sysObject.save();
} catch (Exception e) {
System.out.println("An exception has occured …." + e);
DfLogger.error(null, "An exception has occured ….", null, e);
TestIDfLifecycleUserPostProcessing.java
Double click to open TestIDfLifecycleUserPostProcessing.java and type in the code, after that click
Control-S to save the code.
package com.documentum.lifecyle;
import com.documentum.fc.client.IDfModule;
import com.documentum.fc.client.IDfSysObject;
import com.documentum.fc.common.DfException;
import com.documentum.fc.common.DfLogger;
import com.documentum.fc.lifecycle.IDfLifecycleUserPostProcessing;
@Override
public void userPostProcessing(IDfSysObject sysObject,
String userName, String targetState) throws DfException {
try {
sysObject.appendString("keywords", "TestIDfLifecycleUserPostProcessing");
sysObject.save();
} catch (Exception e) {
} finally {
}
Export as TestLifecycle.jar
Click to select the project, in this example TestLifecyle, right mouse click, select Export.
In the Export popup window, click to expand Java, click to select JAR file, click Next button.
Type C:\Testing\TestLifecycle.jar in the JAR file field, click Finish button.
Click to select the project, in this example TestLifecyle, right mouse click, select New – JAR definition.
In the newly opened testlifecycle.jardef tab, click to select Implementation in the Type drop down.
Click Browse button, to select C:\Testing\TestLifecycle.jar, click Open button.
Click File – Save menu.
Click to select the project, in this example TestLifecyle, right mouse click, select New – Module.
Type com.documentum.lifecyle.IDfLifecycleUserEntryCriteria in the Artifact name field, click Finish
button.
Click to select the project, in this example TestLifecyle, right mouse click, select New – Module.
Click to select the project, in this example TestLifecyle, right mouse click, select New – Module.
Click to select the project, in this example TestLifecyle, right mouse click, select New – Lifecycle.
Click Overview tab below, type In Progress in the Name field, click to select Allow attachments directly
to this state.
Click Entry Criteria tab, click Select button in the Module, select to select
com.documentum.lifecyle.IDfLifecycleUserEntryCriteria, click OK button.
Click Actions tab, click Select button in the Module, select to select
com.documentum.lifecyle.IDfLifecycleUserAction, click OK button.
Click o Post change ab, click Select button in the Module, select to select
com.documentum.lifecyle.IDfLifecycleUserPostProcessing, click OK button.
Click on the newly created NEW_STATE, click Overview tab, type Reviewed in the Name field.
Click Connection.
Click to connect In Progress button to Reviewed button.
Click File – Save.
Click to select the project, in this example TestLifecyle, right mouse click, select Install Documentum
Project.
Select the repository from the Repository name drop down, in this example, it is DocBase1.
Type the User name and Password, in this example, it is dmadmin.
Click Login button.
After login is successful, click on the Finish button.
3. Attach document to lifecycle for testing in Documentum
Administrator
Click to select existing document, in this example, it is Testing1.txt in Testing Folder 1 folder.
Click to select this Testing1.txt document, right mouse click, select Properties.
Click Show all properties check box.