Saturday 10 November 2012

Deployment of JOB related JAR files using DAR

This is my first try to share my little experience with you all. It may be help you some way. If you find any mistake don't hesitate to leave a post so that I can rectify it as soon as possible.

Today I am going to share with you one simple way to deploy the job related jar files using DAR as BOF module. 
                      
                      I used to deploy all my job related class files or JAR files manually in the location %DOCUMENTUM%\dba\java_methods directory in the Content Server. Method Server will include them in its class path automatically. But every time classes are deployed to the method server, we need to restart the method server .


To implement the method as bof module follow the below details :


1. Create one class to implement  IDfMethod, IDfModule, IDfBusinessObject and in this case we need to implement  IDfMethod instead of  IDmMethod :

package com.test.bof.module;

import java.io.PrintWriter;
import java.util.Map;

import com.documentum.fc.client.IDfBusinessObject;
import com.documentum.fc.client.IDfModule;
import com.documentum.fc.methodserver.IDfMethod;

public class TestBofModule implements IDfMethod, IDfModule, IDfBusinessObject{

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

@Override
public String getVendorString() {
// TODO Auto-generated method stub
return  " - ";
}

@Override
public String getVersion() {
// TODO Auto-generated method stub
return null;
}

@Override
public boolean isCompatible(String arg0) {
// TODO Auto-generated method stub
return true;
}

@Override
public boolean supportsFeature(String arg0) {
// TODO Auto-generated method stub
return true;
}

}



2. Implement you business method like below by extending the above class :

package com.test.bof.module;

import java.io.PrintWriter;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;



public class TestJobMethod extends TestBofModule {

public int execute(Map params, PrintWriter arg1) throws Exception {

// TODO Implement your business logic here..
//........
return 0;
}

}


3. Once Business logic is implemented then create one JAR file with your class files and if any other helping classes used.

4. Using composer do the below configuration


      Create one Jar definition :
          
     Create one module and configure like below

     
   
  Then install the dar file in the target repository.


  




Now you can easily do hot deployment of your method implementation without restarting the Method Server.


Please do comment if you want me to add anything extra.











5 comments:

  1. This is very useful for High Availability Applications to avoid outages.

    ReplyDelete
  2. Great article.

    I'm trying to get a server method working using a Job. I've followed your steps above + created a method which calls the module + created a job which calls the method. However, everytime I try and run this I get a failed: method return value: 127.

    Have you been able to get this to work?

    Many thanks

    ReplyDelete
    Replies
    1. Hi Jonathan,

      Procedure defined above is working fine for me.

      Can you please share with me the log files and configuration you have done in composer?

      You can also check whether you implement IDfMethod instead of IDmMethod in your custom method code.

      Delete
    2. In addition,I think returning value is 127 mean method not found exception.

      Delete
    3. Aniket,

      Thanks, I got it working in the end :)

      Great tutorial!

      Cheers
      Jonathan

      Delete

Make life easier — Git automation with single command file

Make life easier — Git automation with single command file Posted on medium #makelifeeasier series - Automation of git related activity...