D2 4.7 ID2Method not loading

Options

Hi we are using D2 4.7 and i have written code but the method is not getting invoked. D2-JMS.log is also not printing the logger. Need your suggestions please. I have put the verb the same way
com.emc.d2.api.methods.D2Method -class_name com.plugin.methods.CreateRelation

public class CreateRelation implements ID2Method, IDfModule{

private static final Logger LOG = LoggerFactory.getLogger(CreateRelation.class);

@Override
public D2methodBean execute(IDfSession session, IDfSysObject job, Locale locale, ArgumentParser argumentParser) throws Exception {
    LOG.info("***********************Inside D2Method**************************");
    System.out.println("***********************Inside D2Method**************************");
    // TODO Auto-generated method stub
    return null;
}

}

Comments

  • Hello!

    Try using DfLogger to generate the statements. I generally find them in JMS log, not D2-JMS log though.

    I tried this earlier and found that the log output depends on many factors, you can find some help from these references:
    https://blog.dbi-services.com/documentum-story-documentum-jms-log-configuration/
    https://blog.dbi-services.com/documentum-how-to-really-configure-the-d2-jms-logs-starting-with-jbosswildfly/

  • Hi,

    I tried with DfLogger but still no luck. I Created the jar along with my plugin and put it inside D2/WEB-INF/lib but seems like my method never gets called. Am i missing something in terms of implementing the ID2Method??

    I followed the above articles to make D2-JMS.log visible. But they don't talk anything about implementing D2Methods.

  • How are you calling this D2 Method by the way ?

    And how did you deploy it to the repository ? As a module ?

  • That's my confusion. Are D2 methods implementation is different that general dm_method implementation?

    I simply bundled it along with the plugin and pushed the jar file inside D2 war file inside lib folder and then calling it through method verb as below -

    com.emc.d2.api.methods.D2Method -class_name com.plugin.methods.CreateRelation

    Let me know if am doing anything wrong.

  • You've to manually copy the JAR file under ../jboss7.1.1/server/DctmServer_MethodServer/deployments/ServerApps.ear/lib

    I think if you bundle it and deploy it through Composer, its treated as a module and D2 Methods unfortunately aren't working in module style.

    Method verb is just fine, so try copying the JAR to Method server location and give it a try

  • Nope still no luck. I just moved the jar file inside ../jboss7.1.1/server/DctmServer_MethodServer/deployments/ServerApps.ear/lib and restarted JMS Then trying to call it through DQL as below but still nothing happening -

    EXECUTE do_method with method = 'CreateRelationMethod', arguments = '-docbase_name D2'

  • What's the input for your D2 method ? I don't see a DQL filter in your EXECUTE method, does that mean you're applying this D2 method to whole repository objects ?

    I am sure that the corresponding docbase on which you're running this D2CoreMethod will have an entry in it's docbase log.

  • Actually i haven't started writing the logic yet for this method. Just was planning to set up the workspace and process how to build it and execute it. Once that is done will start writing the logic.

    Do you have any documentation how the design and implementation is different for dm_method and D2Method? Also any changes in implementation process??

    I don't see any logs in Docbase logs as well.

  • imranganath
    edited March 4, 2019 #10
    Options

    Follow this discussion:

    https://forums.opentext.com/forums/discussion/224883

    You'll get some ideas.

    Let me know if you still have got questions.

  • Thank you so much, it helped. My logs are rolling now and method is getting executed :smile: