This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Dynamic "Workflow map" assignment

zahar - Sunday, November 4, 2012 3:50 AM:

Hello,

I'm wondering if there is option to assign more than 1 workflow (map) to ItemType - how i can do following:

 

  1. Assign 2 Workflow maps to Simple ECO (current one and new one)
  2. When user will use "Add item to Change" and select Simple ECO he will get some dialog that will ask him with of workflow map he want to use
  3. If this is not possible, is there an option after new Simple ECO created (but not saved) - user can change workflow map?

 

 

 



fli - Wednesday, November 14, 2012 4:26 AM:

Hi Zahar,

 

How about using Lifecycle states to kick off the Workflows ?

Ask the user, then depending on the answer promote the Item to the Lifecycle state where the needed Workflow is stated.

 

 / Christoffer



dennis - Monday, January 7, 2013 4:00 PM:

I typically solve this by hooking the workflow maps to the itemtype but do not set a default. Then I hook the onAfterAdd server event of the eco itemtype. The method determines which workflow to start (I typically use the classification but you could use a list or checkbox on the eco form). After that, the method starts the appropriate workflow. Here is some pseudo code.

 

switch (classification)

{

case "Major":

wflMapName = "Major ECO";

break;

case "Minor":

wflMapName = "Minor ECO";

break;

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



zahar - Wednesday, November 14, 2012 6:16 AM:

Nice Idea! I'll try it