D2 Scheduled Workflow

Mayur_shivs
edited October 27, 2017 in Documentum #1

Hello ,

While i was going through D2 4.1 API i came across a couple of methods in com.emc.d2fs.interfaces  Interface IWorkflowService for launching workflow

1)</code></span> <code><strong><a>launchScheduledWorkflow</a></strong>(<a title="class in com.emc.d2fs.models.context">Context</a> context, java.lang.String id) 

           Launch a scheduled workflow.

2)

</code></span></td><td><code><strong><a>launchWorkflow</a></strong>(<a title="class in com.emc.d2fs.models.context">Context</a> context, java.util.List<<a title="class in com.emc.d2fs.models.attribute">Attribute</a>> parameters) 
           Launch document into workflow

so what is difference between Scheduled workflow and Normal workflow , and in case if we use 2nd method ie.

<strong><a>launchWorkflow</a></strong>(<a title="class in com.emc.d2fs.models.context">Context</a> context, java.util.List<<a title="class in com.emc.d2fs.models.attribute">Attribute</a>> parameters) 

           Launch document into workflow

what are the parameters do we need to have in the java.util.List

Best Answer

  • Antal Bos
    edited June 12, 2013 #2 Answer ✓

    I see you only do a request.getAttributes().add(attr); at the end?

    You Attribute object is everytime overwritten in your code.

    So the only item in your Attribute object should be buttonId = buttonOk.

    Try it like this:

    Attribute attr = new Attribute();

    attr.setName("config");

    attr.setType(2);

    attr.setValue("myWorkflow");

    request.getAttributes().add(attr);

    attr = new Attribute();

    attr.setName("workflow_label");

    attr.setType(2);

    attr.setValue("MyWorkflow");   

    request.getAttributes().add(attr);

    attr = new Attribute();

    attr.setName("reviewers");

    attr.setType(2);

    attr.setValue("mayur");

    request.getAttributes().add(attr);

    etc...


Answers

  • jeremyprioux
    edited May 29, 2013 #3

    Hi,

    And the javadoc is not helping on this..

  • Julien.Fontaine
    edited May 29, 2013 #4

    Which Javadoc ?

  • Antal Bos
    edited May 30, 2013 #5

    A scheduled workflow is not started directly, but is triggered by a D2 job based on the future date you send with it.

  • Antal Bos
    edited May 30, 2013 #6

    As far as i know there is a D2FS api available, but i'm not sure if these methods are described in it.

  • Mayur_shivs
    edited June 3, 2013 #7

    Which API are you using or you have found  for attaching workflow to the document in D2

    Regards

  • Antal Bos
    edited June 3, 2013 #8

    We use the 'D2FS 4.1 Javadoc', but it's indeed very minimal and almost unusable.

    One of our developers used a tool called TCPMON.jar and placed it between the JMS and Application server. Then we started a workflow from D2 and picked up the message that was sent. With that message information we could build that message in Java again with the correct attribute-list.

  • Mayur_shivs
    edited June 7, 2013 #9

    does you have the sequence of attributes which needs to pass to the launchWorkflowRequest , if you have that please let me know the sequence

    Regards

  • Antal Bos
    edited June 7, 2013 #10

    For starting a D2 workflow we came to this list:

    attr.setName("list");
    attr.setValue("config");

    attr.setName("config");
    attr.setValue(strWf);

    attr.setName("workflow_label");
    attr.setValue(strWf);

    attr.setName("name");
    attr.setValue(strWf);

    attr.setName("labelNotification");
    attr.setValue("");

    attr.setName("notification");
    attr.setValue("");

    attr.setName("launch_date");
    attr.setValue("");

    attr.setName("launch_notification");
    attr.setValue("");

    attr.setName("end_of_workflow");
    attr.setValue("");

    attr.setName("list");
    attr.setValue("workflow_label¬name¬labelNotification¬notification¬add_document_id¬launch_date¬launch_notification¬end_of_workflow");

  • Mayur_shivs
    edited June 8, 2013 #11

    Thanks for help ,

    but i am somewhat confused on first two and last two lines of the previous answer

    1)

    attr.setName("list");

    attr.setValue("config");

    what should i pass in as "list" and "config" i have tried "d2_workflow_config" for attr.setValue("config"); but that not working

    and in the last two lines

    attr.setName("list");

    attr.setValue("workflow_label¬name¬labelNotification¬notification¬add_document_id¬launch_date¬launch_notification¬end

    what is "list" and whats the separator "workflow_label¬name¬l" ie : "¬" this one

    Regards

  • Antal Bos
    edited June 10, 2013 #12

    This is the message we picked up with tcpmon.jar:


    ==============================================================

    http://localhost:8081/D2/x3_portal/

    |F246E4E08DEEA93E352D73B533D11873

    |com.emc.x3.portal.client.components.dialog.RpcDialogService

    |validDialog

    |java.lang.String/2004016611|java.util.List

    |Repo_DEV-1370844030776-dmadmin-498188302

    |080299be80043750

    |D2WorkflowLaunchDialog

    |java.util.ArrayList/4159755760

    |com.emc.d2fs.models.attribute.Attribute/3907115023

    |list

    |config|myflow

    |workflow_label|My Flow

    |name|My Flow 10 jun 2013 08:03:51

    |labelNotification

    |notification

    |launch_date

    |launch_notification|false

    |end_of_workflow

    |workflow_label¬name¬labelNotification¬notification¬add_document_id¬launch_date¬launch_notification¬end_of_workflow

    |buttonId|buttonOk

    ==============================================================

    We rebuild this message in Java like this (Those '¬' just come with the copy from tcpmon to eclipse):

    //Create a new ValidDialogRequest
    ValidDialogRequest request = new ValidDialogRequest();
    request.setId(<<Object ID of document in Package>>);
    request.setDialogName("D2WorkflowLaunchDialog");
    request.setContext(context);

    //Set all the attributes like in the tcp-message
    attr = new Attribute();
    attr.setName("config");
    attr.setType(2);
    attr.setValue(<<See the tcp-message>>);
    request.getAttributes().add(attr);

    ...

    //Send out the request
    final ValidDialogResponse response = (ValidDialogResponse)new D2FSWebServiceSupport().getWebServiceTemplate().marshalSendAndReceive(request);

  • Mayur_shivs
    edited June 10, 2013 #13

    Thanks for the help , I am not finding "D2FSWebServiceSupport" this class in any of the jar file , so which jar does have this class , I have 4 jars in my classpath

    1) the jar build from D2FS wsdl

    2) streambuffer.jar

    3) D2FS4DCTM-LanguagePack_en_4.0.1_019.jar

    4) D2FS-remote.jar

    Regards

  • Antal Bos
    edited June 10, 2013 #14

    That is a custom Class that extends from org.springframework.ws.client.core.support.WebServiceGatewaySupport

  • Mayur_shivs
    edited June 11, 2013 #15

    Hello

    this is my code

    ValidDialogRequest request = new ValidDialogRequest();

                request.setId("090072e58000b14f");

                request.setDialogName("D2WorkflowLaunchDialog");

                request.setContext(context);

    Attribute attr = new Attribute();

                attr.setType(2);

                attr.setName("list");

                attr.setValue("");

    then i have set the value and name of attributes according to my configuration

    and in the end i am launching it through import com.emc.d2fs.schemas.models.ModelPort;

    like this

    request.getAttributes().add(attr);

          

                port.validDialog(request);

    i am getting this error

    2013-06-10 19:35:23 [INFO ] - c.e.d2fs.dctm.workflow.D2WorkflowLaunch : Launch w

    orkflow for config :

    2013-06-10 19:35:23 [INFO ] - c.e.d2fs.dctm.workflow.D2WorkflowLaunch : Launch w

    orkflow for document  :(090072e58000b14f)

    2013-06-10 19:35:23 [INFO ] - c.e.d2fs.dctm.workflow.D2WorkflowLaunch : Workflow

    tracker name :

    2013-06-10 19:35:23 [ERROR] - c.e.d.dctm.aspects.InjectSessionAspect  : {}

    com.emc.common.dctm.exceptions.C6ObjectNotFoundByNameException: Workflow object

    "" not found.

            at com.emc.common.dctm.utils.DfSessionUtil.getObjectByName(DfSessionUtil

    .java:233) [C6-Common-4.1.0.jar:na]

            at com.emc.d2.api.config.modules.workflow.D2WorkflowConfig.getInstanceBy

    Name(D2WorkflowConfig.java:138) [D2-API-4.1.0.jar:na]

            at com.emc.d2fs.dctm.workflow.D2WorkflowLaunch.process(D2WorkflowLaunch.

    java:126) [D2WorkflowLaunch.class:na]

            at com.emc.d2fs.dctm.dialogs.d2workflows.D2WorkflowLaunchDialog.validDia

    log(D2WorkflowLaunchDialog.java:232) [D2WorkflowLaunchDialog.class:na]

            at com.emc.d2fs.dctm.web.services.dialog.D2DialogService.validDialog_aro

    undBody2(D2DialogService.java:140) [D2DialogService.class:na]

            at com.emc.d2fs.dctm.web.services.dialog.D2DialogService$AjcClosure3.run

    (D2DialogService.java:1) [D2DialogService$AjcClosure3.class:na]

            at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:

    221) [aspectjrt-1.6.11.jar:na]

            at com.emc.d2fs.dctm.aspects.InjectSessionAspect.process(InjectSessionAs

    pect.java:134) [InjectSessionAspect.class:na]

            at com.emc.d2fs.dctm.web.services.dialog.D2DialogService.validDialog(D2D

    ialogService.java:120) [D2DialogService.class:na]

            at com.emc.d2fs.endpoints.DialogServiceEndpoint.handleValidDialogRequest

    (DialogServiceEndpoint.java:156) [D2FS-4.1.0.jar:na]

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0

    _27]

            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [na:1.6.0

    _27]

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [na:1

    .6.0_27]

            at java.lang.reflect.Method.invoke(Unknown Source) [na:1.6.0_27]

            at org.springframework.ws.server.endpoint.MethodEndpoint.invoke(MethodEn

    dpoint.java:132) [spring-ws-core-2.0.4.RELEASE.jar:na]

            at org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointA

    dapter.invokeInternal(DefaultMethodEndpointAdapter.java:229) [spring-ws-core-2.0

    .4.RELEASE.jar:na]

    how to resolve this

    Regards

  • Antal Bos
    edited June 11, 2013 #16

    It looks like it searches for a workflow without a name:

    com.emc.common.dctm.exceptions.C6ObjectNotFoundByNameException: Workflow object

    "" not found.

    Did you set these attributes:

    config = <name of the workflow in D2>

    workflow_label = <label of the workflow in D2>

    name = <name of the workflow in BPM/workflow manager>

    ?

  • Mayur_shivs
    edited June 11, 2013 #17

    Yes i have set these

                attr.setName("config");

                attr.setValue("myWorkflow");

                attr.setName("workflow_label");

                attr.setValue("MyWorkflow");

                attr.setName("name");

                attr.setValue("Workflow 1");// 10 Jun 2013 17:35:35");

    but when i am remote monitored TCP messages i am getting like this

    |list

    |config

    |myWorkflow

    |workflow_label

    |name

    |myWorkflow 11 Jun 2013 11:08:13

    |reviewers

    |mayur

    |approvers

    |labelNotification

    ||notification

    |launch_date

    |launch_notification

    |false

    |end_of_workflow

    |workflow_label¬name¬reviewers¬approvers¬rewriters¬labelNotification¬notification¬add_document_id¬launch_date¬launch_notification¬end_of_workflow

    |buttonId

    |buttonOk

    i am getting time stamp  with name , so that time stamp is going to change every time , so does this error is from this thing

    and if the value of any field is empty i am doing like this

                attr.setName("launch_date");

                attr.setValue(" ");

    is this the right way

    Regards

  • Antal Bos
    edited June 12, 2013 #18

    This information is incorrect:
    name = <name of the workflow in BPM/workflow manager>


    The name can be a selve described name, so you are free to use your own name as far as i can see.

    .The launch_date can be used to start the workflow on a later time with the D2 job 'D2JobWFLaunchScheduledWorkflows'

  • Antal Bos
    edited June 12, 2013 #19 Answer ✓

    I see you only do a request.getAttributes().add(attr); at the end?

    You Attribute object is everytime overwritten in your code.

    So the only item in your Attribute object should be buttonId = buttonOk.

    Try it like this:

    Attribute attr = new Attribute();

    attr.setName("config");

    attr.setType(2);

    attr.setValue("myWorkflow");

    request.getAttributes().add(attr);

    attr = new Attribute();

    attr.setName("workflow_label");

    attr.setType(2);

    attr.setValue("MyWorkflow");   

    request.getAttributes().add(attr);

    attr = new Attribute();

    attr.setName("reviewers");

    attr.setType(2);

    attr.setValue("mayur");

    request.getAttributes().add(attr);

    etc...


  • Mayur_shivs
    edited June 12, 2013 #20

    : Thanks very much Guru , Struggled a lot for this , tried lots of thing but it was eventually you who solved this big problem

    Regards

  • Antal Bos
    edited June 12, 2013 #21

    You're welcome!

  • Nitesh
    edited October 31, 2013 #22

    Hi Mayur,

    How to get the classes for ModalPort from wsdl?

    Regards,

    Nitesh

  • Mayur_shivs
    edited December 11, 2013 #23

    Hi Nitesh ,

    Did you got the answer if not here is the procedure

    Use the wsimport command (included with your JDK) to generate a set of java source

    files for the stub libraries you will need to connect. Add the -keep option in order to

    EMC Documentum D2 4.1 Architecture 10

    preserve the generated java files after the command has finished running. Depending on

    where you have deployed D2, the command will look something like:

    wsimport -keep http://localhost:8080/D2/ws/d2fs.wsdl

    Build the JAR file for generated classes and add it in your project

    Regards

  • Shilpa_A123
    edited October 27, 2017 #24

    Hi Mayur,

    Could you please provide code for 'D2FSWebServiceSupport' mentioned in post? I'm struggling with this and not getting details. If you can provide pointers, it would be great.


    Thanks,

    Shilpa