Home Documentum

Recursive Folder Creation (Single Activity) using Workflows

edited December 7, 2016 in Documentum

Hi all,

I have a couple of months of experience in documentum.

Now I am working on workflows.

My requirement is like to create recursive folders dynamically by reading the values from XML file.

In the tags of XML file the names for the folders will be mentioned.

Please suggest me how to proceed.

Any help will be greatly appreciated.

Thanks and Regards,



  • edited November 28, 2016

    This is unique requirement.  Look in the DFC java docs if you intend to do any custom development.

  • edited November 29, 2016

    Hi Johnny,

    Thanks for your response but please suggest me how to create recursive folders. I need to check if the folder is present in the repository i need not to create it if it is not present then create it. This criteria i need to do for 6 folders. . Also I should not hard-code the folder path.Please suggest me how to move on.

    Thank you.

  • edited November 29, 2016

    The idea is:

    Parse your folder path, say using tokenizer or other ways. i.e. /CABINETS/FolderA/FolderB/FolderC, by "/" separator, which will give you in this example 4 elements CABINETS, FolderA FolderB and FolderC.

    Then loop through, and verify whether each folder exists, if it does, then continue, else, create it.

    It's good idea to make this operation as SBO, so it can be leveraged through out the application. You need to pass probably a IDfSession variable, and a String folder path. then let the SBO takes care of verifying and creating the folder.

    Good idea would be to make the verify operation *synchronized*, to prevent simultaneous creation of the same folder, since/if it's a web app client.

  • edited November 30, 2016

    Hi Ahmed. Thanks for your response. If you please help me to send sample DFC code to do this.

    We are preferring to use only workflows not SBO. Please try to respond.

    Thank you.

  • edited November 30, 2016

    Look in the Documentum Component Exchange for sample code:


  • edited December 1, 2016

    Thank you Johnny for sharing information.

    It was really helpful.

    Thanks a lot.

  • edited December 5, 2016

    Hi Johnny. Recursive folder creation is about to complete.

    But please help me to know how to configure loggers in Workflows/Activities.

  • edited December 5, 2016

    Logging is done via log4j on JMS.  This is where server methods that your workflow calls is executed.

  • edited December 5, 2016

    My log4j configuration:




    log4j.appender.recursivefolder.layout.ConversionPattern=%d{yyMMdd HH:mm:ss,SSS} %-5p %c | %m%




    This code I updated in location  E:\Documentum\jboss7.1.1\server\DctmServer_MethodServer\deployments\ServerApps.ear\APP-INF\classes\log4j.properties

    The log file is created but the messages are not logged into the file.

    log4j.rootCategory=WARN, A1, F1 is the first statement int he log4j.properties

    How to proceed. Please Explain.

    Thank you.

  • edited December 5, 2016

    change WARN to DEBUG

  • edited December 5, 2016

    Please provide sample of your debugging statement as well.

  • edited December 5, 2016

    Hi Johnny.Please refer debugging statements.

    protected int doTask(IDfWorkitem idfworkitem, IDfProperties idfproperties, PrintWriter printwriter)

             throws Exception{

      DfLogger.debug(this, "Executing doTask()..",  null, null);

             IDfSessionManager idfsessionmanager;

             String folder_full_name;

             String type="dm_folder";

             folder_full_name =(idfproperties.getString(CONTAINING_FOLDER_NAME));


             String pathSep="/";

             String basePath="";

             idfsessionmanager = getSessionManager();

             int i;

             //String folderPath=" '"+CONTAINING_FOLDER_NAME+"' ";

             String folderPath=""+folder_full_name+"";

             DfLogger.debug(this, "Folder Path Obtained",  null, null);

    These statements are not logged into the log file. All the statements in my code are DfLogger.debug(this,"  ",null,null);

    Thanks for your response.

  • edited December 6, 2016

    Did you clear the JMS cache and restart the JMS after making your log4j changes?

  • edited December 6, 2016

    Yes I cleared JMS cache and restart the JMS but no results.

    Thank you

  • edited December 7, 2016

    If you still have this statement:

    log4j.rootCategory=WARN, A1, F1

    Then log4j is looking appender options called A1, F1.  In your example, your appender option is called recursivefolder, so


Sign In or Register to comment.