IT Process Automation

  • 1.  how to create a valueMap process dataset variable.

    Posted Jun 13, 2017 11:42 AM

    Hello Community,

    Task Level 1:

                pcat:1
                pcat:2
                pcat:3
                pcat:4
                pcat:5
                pcat:6

    Task Level 2:

             pcat:xxxxx
             pcat:xxxxx
             pcat:xxxxx
             pcat:xxxxx
             pcat:xxxxx

    Task Level  3:
             pcat:xxxxx
             pcat:xxxxx
             pcat:xxxxx
             pcat:xxxxx

     

    so on .... I have 10 Task levels and each task have different set of categories.

    I am looking to create a Process data-set variable which will store above task level and category Id mappings.

     

    Workflow Design  : 

    when a ticket gets resolved this process will trigger in PAM, so in the workflow i am getting the category of ticket and I want to search against the data-set variable to get the associated task level.

     

    In the next step, the flow the process will be decided by the Task level

     

     

    any help on how to create a process data set and how to search the data-set variable to get the associated task levels.

     

    Thanks In advance.

     

    Venkat



  • 2.  Re: how to create a valueMap process dataset variable.

    Community Manager
    Posted Jun 15, 2017 10:54 AM

    Andy_Thompson or MWNiebuhr -- can you help here?



  • 3.  Re: how to create a valueMap process dataset variable.
    Best Answer

    Posted Jun 15, 2017 01:49 PM

    I am no Andy nor Michael but i can answer this

     

    Imagine :

     

    pcat_lvl_mapping = ValueMap

    lvl1, lvl2, lvl3 = ValueMap

     

    Each pcatList = string array (single)

     

     

    Code :

     

    Process.testPcat="pcat:22222";

    Process.lvlList = getValueMapFields(Process.pcat_lvl_mapping);

    for(i=0;i<lvlList.length;i++)
    {

    if(typeof Process.lvlOfPcat != "undefined" && Process.lvlOfPcat != "")
    break;
    Process.step.push(lvlList[i]);//For testing purposes only
    for(j=0;j<Process.pcat_lvl_mapping[lvlList[i]].pcatList.length;j++)
    {

    Process.step.push(pcat_lvl_mapping[lvlList[i]].pcatList[j]);//For testing purposes only
    if(Process.pcat_lvl_mapping[lvlList[i]].pcatList[j] == testPcat)
    {
    Process.lvlOfPcat=lvlList[i];
    break;
    }
    }
    }

     

     

    So basically you use getValueMapFields to get a list of the valueMap contained inside a specific valueMap.

    lvlList will contains :

     

    Then you check every values in every pcatList by accessing each "lvlx" valueMap one by one with the first loop.

     

    When it finds it, it wirtes the current valueMap being iterated then breaks.

     

    The result is : 

     

    Sorry for the fuzzy explanation, it's easier to code than to explain



  • 4.  Re: how to create a valueMap process dataset variable.

    Posted Jun 15, 2017 03:02 PM

    May i suggest a different approach?

     

    Why not add an attribute in the pcat object in SDM ?

     

    something like z_pcatlvl (integer)

     

    And when you trigger your workflow, just when you use a doSelect to obtain the ticket information, simply add category.z_pcatlvl to the attributes list.

     

     

    This way you will be able to create a new category (and set it's z_pcatlvl attribute) and expect it to take the correct path in your workflow without having to edit your dataset

     

    And finally, it will works across all your environnement (dev, acc, prod etc.) Sometimes you do not have the same ids between them.



  • 5.  Re: how to create a valueMap process dataset variable.

    Posted Jun 19, 2017 09:13 AM

    pier-olivier.tremblay

     

    Thanks for your suggestion,

     

    I have created as valueMap as fallows.

     

     

     

    below is the code to find the category 

     

    Process.tktCtg  -  Category of the ticket

    for (var j = 0; j < Process.taskMappings.length; j++) {
    for (var k = 0; k < Process.taskMappings[j].CategoryId.length; k++) {
    if (Process.taskMappings[j].CategoryId[k] == Process.tktCtg) {
    Process.nowTaskLevel = Process.taskMappings[j].Level;
    break;
    }

    }
    }

     

    The Other Approach is easy and simple but as of now, I have asked to managed this in the scope of IT PAM .

     

    Regards,

    Venkat