Need help/hints to deploy a Java method and create a job

athati
edited May 24, 2012 in Documentum #1

Hi,

Using Composer I have created a Java class with a method to send emails to task-owners if one or more tasks are there in their inboxes. Now I need to deploy the same on to Content Server and schedule a job for the same. How can I deploy the code? I think it needs to be deployed into deploy folder under JBoss. Please give me the steps. Later I need to create a method object and a job using DA. I can refer to DA, but if you give me any specifics, that would be a great help.

Please share your knowledge and experiences for figuring this out.

Thanks.

ta

Tagged:

Best Answer

  • pettitk
    edited April 27, 2012 #2 Answer ✓

    The jar file goes in dba_methods dir. It doesn't matter how you create the dm_method object or dm_job object. You can create those in DA, composer, dql script. You can even use DA then import the artifact to DA. If you need to migrate the job to another repository then at some point it may make sense to have it in composer.

    --

    Kyle Pettit

Answers

  • CláudioGil
    edited April 27, 2012 #3

    I try to avoid deploying code explicitly to the method server because it makes installations more complicated.

    In this case you can, using composer, create a Documentum project with all you need

    • Jardef
    • Module
    • Method
    • Job

    The trick is to use the module's name as the method's command and use the method's name as the job's method.

    The module will refer to a Jardef that contains the implementation of your method. I think this implementation only needs to be a class that implements IDfMethod (to be a method) and IDfModule (to be a module). I think the administration guid says what you need exactly.

    Using this approach you can install the project and everything will be in place. If you change the jardef and reinstall the project then the Method Server will pickup your changes (sometimes, in version 6.0, it would not but I only had to restart the method server). You can monitor the ${dfc.data.dir}/cache just to make sure you jardef is updated. You can also customize dfc.properties to append names to the jardefs so you know exactly which one is yours (this will probably remove the .jar from the files but it will still work).

    Cheers,

    Cláudio

  • yamangoyal
    edited April 27, 2012 #4

    Fist Create a Method from DA and specify full qualification like com.athiti.abc.classname and then create job using this method, then deploy your class to CS inside java_methods folder and restart method server.

  • athati
    edited April 27, 2012 #5

    Thanks Claudio.

    I created a class that implements IDmMethod and created 'execute' method using composer. I am not aware of Jardef and Module. Can't I create e Method object and Job using composer with what all I have done so far at this point? Are Jardef and Module are must? What are they? Where can I get more info on these? If they are required, how can I do the same from the point where I am now? I am confused at this point. I am using DCTM 6.7 (CS 6.7, Composer 6.7 and Tomcat 6.0).

    Please advise me.

    Thanks.

    ta

  • athati
    edited April 27, 2012 #6

    Thanks yamangoyal.

    I created a class that implements IDmMethod and created 'execute' method using composer. Do you think creating a method object and a Job using DA as you mentioned is the best approach? Isn't the same using Composer better. It is first time I am doing this and getting so many questions.

    Please advise me.

    Thanks.

    ta

  • pettitk
    edited April 27, 2012 #7

    You don't use jardef or modules w methods that run via the java method sever. The disc we had last week is still accurate.

    --

    Kyle

  • pettitk
    edited April 27, 2012 #8 Answer ✓

    The jar file goes in dba_methods dir. It doesn't matter how you create the dm_method object or dm_job object. You can create those in DA, composer, dql script. You can even use DA then import the artifact to DA. If you need to migrate the job to another repository then at some point it may make sense to have it in composer.

    --

    Kyle Pettit

  • athati
    edited May 21, 2012 #9

    Kyle,

    I created the method code with 'execute' method. I also tested the code with  Java 'main' and the method could send emails, but after I deploy the method by creating method object and also by creating a JOB, when I run the method, it looks it is not running. Would you please give me the steps to deploy correctly? I am not sure what I am missing.

    Note: You mentioned that JAR file goes into do_method dir. Can you say clearly? Do you mean the JAR containing our method code? Can you please give me the full path for do_method dir?

    Thanks.

    ta

  • regisroy
    edited May 22, 2012 #10

    Hi

    I think the simplier way to achieve this is to (listen to yamangoyal) :

    - create a simple java project (with eclipse) and import dfc.jar

    - compile and copy your 'com....' folder into Documentum/dba/java_methods

    - Restart Java method server

    - create a dm_method with da that points to your java class

    - create a job for your method

    After that, if you want, and have time to losse, you can try to create a jar and try to execute it within jboss server. You may need to clear jboss work, tmp folder, and Documentum/cache folder as well. Then restart Java method server and be patient. In fact, go and have a cup of tea... then come back and test

  • athati
    edited May 23, 2012 #11

    Thanks rroy.

    The issue is resolved, but I am not sure how I can ward you.

    Thanks again for your help.

    ta

  • regisroy
    edited May 24, 2012 #12

    Don't worry, you already made a response correct

    I'm just happy you resolved your issue.