cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7228
Views
15
Helpful
6
Comments
Orf Gelbrich
Cisco Employee
Cisco Employee

Tutorial on how to build a double selector (drop down) where one selection depends on another.

The goal is at execution time of a workflow to display something like this:

Screen Shot 2014-12-02 at 6.23.20 AM.png


Step 1


In Policies -> Orchestration -> Custom Workflow Inputs create 2 variables like this:



The servers:

Screen Shot 2014-12-02 at 6.16.41 AM.png


The Environment:


Screen Shot 2014-12-02 at 6.16.57 AM.png

The result should look like this:


Screen Shot 2014-12-02 at 6.16.27 AM.png


Create a workflow:


Screen Shot 2014-12-02 at 6.22.37 AM.png


The workflow will have 2 input variables defined like this:


Screen Shot 2014-12-02 at 6.24.04 AM.png


Here are the details on the server variable (Main point to note here is the Filter with CONTAINS variable):


Screen Shot 2014-12-02 at 6.24.22 AM.png



Upon workflow execution the drop down will display the following:


Production:


Screen Shot 2014-12-02 at 6.22.59 AM.png


Test:


Screen Shot 2014-12-02 at 6.23.13 AM.png


Development


Screen Shot 2014-12-02 at 6.23.20 AM.png



Other Filter Examples:


Screen Shot 2014-12-02 at 4.59.02 PM.png


More Filter Examples:


Problem:   The drop down has a Default Select... in it:



Screen Shot 2015-02-13 at 2.26.30 PM.png



The filter to eliminate the problem:


Screen Shot 2015-02-13 at 1.59.14 PM.png


The result:


Screen Shot 2015-02-13 at 1.55.14 PM.png


Multi Select list by Mohamed Arif Hajamohideen:


This task will create the Multi-select List type LOV.

It will work with both workflow and task level.

Steps:

1.       Execute the workflow ‘registerLOV’.

          It will create the Multiselect LOV of Type ‘LOVLIST3TYPE’.

          Please note that The LOV type ‘LOVLIST3TYPE’ will be created after executing this task

2.       Create the custom task with the input field of type ‘LOVLIST3TYPE’.

          Please refer the workflow  ‘multiselect LOV workflow’

3.       If you require workflow level input then add the workflow property of type LOVLIST3TYPE"

task which will create the Multi-select List type LOV.

          It will work with both workflow and task level.

Unknown.png

Unknown-1.png

Unknown-2.png

Filter by list of letters example (Presented by (Jeremy Guthrie (CDW))):

The CONTAINS parameter:

Screen Shot 2016-02-13 at 9.13.37 AM.png

The list of letters custom variable:

Screen Shot 2016-02-13 at 9.13.50 AM.png





Screen Shot 2017-02-06 at 12.40.32 PM.png


Screen Shot 2017-02-06 at 2.12.21 PM.png



Here is the register code that reads from CSV and created the LOV for multi select:

importPackage(com.cloupia.service.cIM.inframgr.customactions);

importPackage(com.cloupia.service.cIM.inframgr.forms.wizard);

importPackage(com.cloupia.service.cIM.inframgr);

importPackage(com.cloupia.model.cIM);

importPackage(com.cloupia.feature.powershellAgentController.wftasks);

importPackage(com.cloupia.lib.cIaaS.network.model);

importPackage(com.cloupia.service.cIM.inframgr);

importPackage(com.cloupia.service.cIM.inframgr.workflowmgr);

importPackage(com.cloupia.service.cIM.inframgr.customactions);

importPackage(com.cloupia.service.cIM.inframgr.forms.wizard);

importPackage(com.cloupia.service.cIM.inframgr);

importPackage(com.cloupia.model.cIM);

importPackage(com.cloupia.feature.customactions.lovproviders);

importPackage(java.util);

importPackage(java.io);

importPackage(com.cloupia.service.cIM.inframgr.forms.wizard);

function createLOV() {

  var lov = new Array();

// lov[0] = new FormLOVPair(a, a);

// lov[1] = new FormLOVPair("two", "two");

// lov[2] = new FormLOVPair("three", "three");

// lov[3] = new FormLOVPair("four", "four");

// lov[4] = new FormLOVPair("five", "five");

// lov[5] = new FormLOVPair("five5", "five5");

var tokens;

for (var i=0;i<UCSD.length; i++)

{

  logger.addInfo("UCSD content: "+UCSD[i]);

  tokens = UCSD[i];

  logger.addInfo("tokens : "+tokens);

  logger.addInfo("tock.. 0: "+tokens[0]);

  logger.addInfo("tock.. 1: "+tokens[1]);

  lov[i] = new FormLOVPair(tokens[0], tokens[1]);

}     

  return lov;

}

  logger.addInfo("Read File /tmp/info4.csv.........");

  var fileReader = new FileReader("/tmp/info4.csv");

  var br = new BufferedReader(fileReader);

  var tokens;

  var UCSD = new ArrayList();

  var lov = new Array();

  logger.addInfo("before loop.........");

  var i=0;

  while(true){

        var line = br.readLine();

        if(line == null)break;

      logger.addInfo("Line" + line);

        tokens = line.split(",");

// lov[i] = new FormLOVPair(tokens[0], tokens[1]);

  logger.addInfo("tock 0: "+tokens[0]);

  logger.addInfo("tock 1: "+tokens[1]);

  i=i+1;

  if(tokens != null && tokens.length > 0){

              UCSD.add(tokens);

        }

  }

  br.close();

logger.addInfo("tokens.length: "+tokens.length);

logger.addInfo("UCSD Length: "+UCSD.length);

var tokens;

for (var i=0;i<UCSD.length; i++)

{

  logger.addInfo("UCSD content: "+UCSD[i]);

  tokens = UCSD[i];

  logger.addInfo("tokens : "+tokens);

  logger.addInfo("tock.. 0: "+tokens[0]);

  logger.addInfo("tock.. 1: "+tokens[1]);

}

var lovRegistry = LOVProviderRegistry.getInstance();

var dataProvider = new com.cloupia.service.cIM.inframgr.forms.wizard.LOVProviderIf({

  getLOVs : function(session) {

  return createLOV();

  }

});

lovRegistry.registerProvider("LOVLIST5", dataProvider);

var registry = CustomFeatureRegistry.getInstance();

registry.registerWorkflowInputFieldType("LOVLIST5TYPE", "LOV List5", FormFieldDefinition.FIELD_TYPE_MULTI_SELECT_LIST, "LOVLIST5");

logger.addInfo("successfully registered  LOVLIST5TYPE with name LOV LIST5 and made it available as a global workflow input with type LOVLIST5TYPE");


Comments
Stephen Watkins
Level 1
Level 1

Great example of documenting a workflow

nsuryadh
Cisco Employee
Cisco Employee

Thanks Orf.

The custom LOV only allow user to select 1 entry from custom list.

Is there any way to select multiple values?

I was thinking to use custom LOV to get list of values, then use it in loop in workflow.

shawnmize01
Community Member

I do not see the "Input Filter Criteria" in my test.  I am using version 6.  

Orf Gelbrich
Cisco Employee
Cisco Employee

I just imported the double LOV example into my UCSD 6.5 set up and it works:

I am wondering how your variable is set up? Or how does it differs from this example?

shawnmize01
Community Member

Here is the inputs:

Here is the workflow inputs. As shown, I do not see the input criteria under admin input.

-Shawn

ppenmeth
Level 4
Level 4

Hi Shawn,

Please see the below screenshots. You need to select 'Admin Input Filter' checkbox than 'Admin Input' checkbox.

Screen Shot 2017-08-08 at 17.32.49.png

Screen Shot 2017-08-08 at 17.33.00.png

Thanks,

Phani

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links