666 Views 9 Replies Last post: Jul 28, 2010 4:49 AM by DCTM_Guru Writing Custom method program(实现自定义的Documentum方法)
Writing Custom method program(实现自定义的Documentum方法) Writing Custom method program(实现自定义的Documentum方法) 85 posts since
Oct 28, 2009
 
Currently Being Moderated

Jul 19, 2010 4:40 AM

Writing Custom method program

Hi All,

 

First time I am writing my own custom method program in java.

 

My simple custom method java program is Test_Method.java , as follow.

 

package com.sunita;

import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Map;
import com.documentum.fc.methodserver.IDfMethod;

/**
* @author Administrator
*
*/
public class Test_Method implements IDfMethod {

/**
  * @param args
  */
public void execute(Map parameters, OutputStream output) throws Exception {
  System.out.println("hi i have run successfully ");
}

public int execute(Map arg0, PrintWriter arg1) throws Exception {
  // TODO Auto-generated method stub
  return 0;
}
}

 

After that i have kept the Test_Method.class file inside the $Documentum\dba\java_methods, as shown in the following screenshot (Test_Method.PNG)

 

------->  Now I have created my custom method in DA, name as test_method, as shown in the following screenshot (cutom_method.PNG)

 

Now I have restarted the java method server. But after restarting java method server, this Test_Method class is not calling, as shown in the server log (server log path is E:\Documentum6.5\jboss4.2.0\server\DctmServer_MethodServer\log)

 

2010-07-19 15:49:50,312 INFO  [org.jboss.web.tomcat.service.TomcatDeployer] deploy, ctxPath=/bpm, warUrl=.../deploy/bpm.ear/bpm.war/
2010-07-19 15:49:51,078 INFO  [STDOUT] <DCTM>
2010-07-19 15:49:51,078 INFO  [STDOUT] <
2010-07-19 15:49:51,078 INFO  [STDOUT] INFO
2010-07-19 15:49:51,078 INFO  [STDOUT] >
2010-07-19 15:49:51,078 INFO  [STDOUT] Documentum Java Method Server
2010-07-19 15:49:56,937 INFO  [STDOUT] <DCTM>
2010-07-19 15:49:56,937 INFO  [STDOUT] <
2010-07-19 15:49:56,937 INFO  [STDOUT] INFO
2010-07-19 15:49:56,937 INFO  [STDOUT] >
2010-07-19 15:49:56,937 INFO  [STDOUT] Docbase Names = DCTM_Repository
2010-07-19 15:49:56,937 INFO  [STDOUT] <DCTM>
2010-07-19 15:49:56,937 INFO  [STDOUT] <
2010-07-19 15:49:56,937 INFO  [STDOUT] INFO
2010-07-19 15:49:56,937 INFO  [STDOUT] >
2010-07-19 15:49:56,937 INFO  [STDOUT] Host Names = svctag-bpmbp51
2010-07-19 15:49:56,937 INFO  [STDOUT] <DCTM>
2010-07-19 15:49:56,937 INFO  [STDOUT] <
2010-07-19 15:49:56,937 INFO  [STDOUT] INFO
2010-07-19 15:49:56,937 INFO  [STDOUT] >
2010-07-19 15:49:56,937 INFO  [STDOUT] IP Addresses = 10.26.116.26, 127.0.0.1, 0:0:0:0:0:0:0:1
2010-07-19 15:49:56,937 INFO  [STDOUT] <DCTM>
2010-07-19 15:49:56,937 INFO  [STDOUT] <
2010-07-19 15:49:56,937 INFO  [STDOUT] INFO
2010-07-19 15:49:56,937 INFO  [STDOUT] >
2010-07-19 15:49:56,937 INFO  [STDOUT] Java Method Dir = E:\Documentum6.5\dba\java_methods
2010-07-19 15:49:56,937 INFO  [STDOUT] <DCTM>
2010-07-19 15:49:56,937 INFO  [STDOUT] <
2010-07-19 15:49:56,937 INFO  [STDOUT] INFO
2010-07-19 15:49:56,937 INFO  [STDOUT] >
2010-07-19 15:49:56,937 INFO  [STDOUT] DoMethod CLASSPATH=%CLASSPATH%;E:\Documentum6.5\dba\java_methods\
2010-07-19 15:49:56,968 INFO  [org.jboss.deployment.EARDeployer] Started J2EE application: file:/E:/Documentum6.5/jboss4.2.0/server/DctmServer_MethodServer/deploy/bpm.ear/
2010-07-19 15:49:56,968 INFO  [org.jboss.deployment.EARDeployer] Init J2EE application:

 

Kindly help me on this.

 

Thanks in advance.

Attachments:
Writing Custom method program(实现自定义的Documentum方法) Writing Custom method program(实现自定义的Documentum方法) 37 posts since
Mar 20, 2008
Currently Being Moderated
1. Jul 19, 2010 8:15 AM Writing Custom method program(实现自定义的Documentum方法) in response to: dipusonu
Re: Writing Custom method program

You have to deploy your java class to a folderstructure matching your java package:

 

$DOCUMENTUM\dba\java_methods\com\sunita

Writing Custom method program(实现自定义的Documentum方法) Writing Custom method program(实现自定义的Documentum方法) 11,285 posts since
Oct 24, 2006
Currently Being Moderated
2. Jul 19, 2010 8:36 AM Writing Custom method program(实现自定义的Documentum方法) in response to: RalfKahrl
Re: Writing Custom method program

Also, how are you calling method?  Normally, a job is configured to call the method and the job passes arguments (required by method) in order for the method to create the repository session.

Writing Custom method program(实现自定义的Documentum方法) Writing Custom method program(实现自定义的Documentum方法) 11,285 posts since
Oct 24, 2006
Currently Being Moderated
4. Jul 23, 2010 4:35 AM Writing Custom method program(实现自定义的Documentum方法) in response to: dipusonu
Re: Writing Custom method program

Try deploying your class in the $DM_HOME/lib.

Writing Custom method program(实现自定义的Documentum方法) Writing Custom method program(实现自定义的Documentum方法) 11,285 posts since
Oct 24, 2006
Currently Being Moderated
6. Jul 25, 2010 5:46 AM Writing Custom method program(实现自定义的Documentum方法) in response to: dipusonu
Re: Writing Custom method program

Oops, maybe its $DOCUMENTUM.  Nonetheless, the directory should be E:\Documntum6.5\product\6.5\lib

Writing Custom method program(实现自定义的Documentum方法) Writing Custom method program(实现自定义的Documentum方法) 377 posts since
Sep 30, 2009
Currently Being Moderated
7. Jul 26, 2010 12:27 AM Writing Custom method program(实现自定义的Documentum方法) in response to: dipusonu
Re: Writing Custom method program

Please be careful when creating methods.

 

There's a difference between IDfMethod and IDmMethod.

 

If you use the IDfMethod interface, you should create a module for your method and deploy the method using Composer/DAB.

No changes needed at the methodserver because evrything is handled by BOF.

 

If you use IDmMethod, you should place the method + required jars in $DOCUMENTUM/dba/java_methods.

 

 

I don't know if mixing these 2 approaches is good practice.

 

 

Using the IDmMethod approach is possibly the easiest way to create a method, unless your method is using custom TBOs/SBOs (or other custom modules).

It does require an extra jar to be referenced to develop it (mthdservlet.jar, can be found at $DOCUMENTUM/dfc/jboss4.2.0/server/DctmServer_MethodServer/deploy/ServerApps.ear/DmMethods.war/WEB-INF/lib at the Content Server).

Writing Custom method program(实现自定义的Documentum方法) Writing Custom method program(实现自定义的Documentum方法) 11,285 posts since
Oct 24, 2006
Currently Being Moderated
9. Jul 28, 2010 4:49 AM Writing Custom method program(实现自定义的Documentum方法) in response to: dipusonu
Re: Writing Custom method program

Thanks for posting your results Sunita.  This will help other beginners as well.

 

相关文章:

  • 2021-08-22
  • 2021-12-13
  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2021-09-06
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
相关资源
相似解决方案