Dynamic Workflow for DCO

Hi,

I want to have multiple workflows for different DCO subclasses. I've seen a code here but I can not work with it.

the code is : 

switch (classification)

{

case "DCO I":

wflMapName = "Express DCO-I";

break;

case "DCO II":

wflMapName = "Express DCO-II";

break;

}
Item wflMap = inn.getItemByKeyedName("Workflow Map",wflMapName);
Item wfl = this.instantiateWorkflow(wflMap.getID());
Parents
  • Hi Dkahraman

    Please try using the below method

    string workflowName = "Express DCO-II";
    Item workflowMap = this.newItem("Workflow Map", "get");
    workflowMap.setAttribute("select", "id");
    workflowMap.setProperty("name", workflowName);
    Item result = workflowMap.apply();
    string mapId = result.getProperty("id");
    Item workflowProcess = this.instantiateWorkflow(mapId);
    workflowProcess.apply("startWorkflow");
    return this;

    I have a package uploaded here. You can import it using import tool.

    Once import is done, re-login to application, create DCO, select DCO type in drop down that will assign workflow dynamically.

    Thank You

    GK

Reply
  • Hi Dkahraman

    Please try using the below method

    string workflowName = "Express DCO-II";
    Item workflowMap = this.newItem("Workflow Map", "get");
    workflowMap.setAttribute("select", "id");
    workflowMap.setProperty("name", workflowName);
    Item result = workflowMap.apply();
    string mapId = result.getProperty("id");
    Item workflowProcess = this.instantiateWorkflow(mapId);
    workflowProcess.apply("startWorkflow");
    return this;

    I have a package uploaded here. You can import it using import tool.

    Once import is done, re-login to application, create DCO, select DCO type in drop down that will assign workflow dynamically.

    Thank You

    GK

Children