SunsetProv.Indices<-function(recipe,data){
    index_name<-names(recipe$Analysis$Workflow$Indices)
    parentnodename_fcst<-graph$parentnodename$parentnodename_fcst
    parentnodename_hcst<-graph$parentnodename$parentnodename_hcst
    parentnodename_obs<-graph$parentnodename$parentnodename_obs
    graph<-data$graph.prov
    class<-switch(index_name,
                  "NAO"="ds:NAO",
                  "Nino1+2"="ds:Nino1plus2",
                  "Nino3"="ds:Nino3",
                  "Nino3.4"="ds:Nino3.4",
                  "Nino4"="ds:Nino4",
                )
  
    #Climate Index type node
    index.nodename<-paste0("ClimateIndex")
    graph <- add_vertices(graph,
                          nv = 1,
                          name = index.nodename,
                          label=index_name,
                          className = class
                          )
    nodenames<-list()
    for(parentnodename in c(parentnodename_hcst, parentnodename_obs)){
      type <- strsplit(parentnodename,"_")[[1]][[2]]
      climin.nodename<-paste0("ClimateIndex_",type)
      graph <- add_vertices(graph,
                            nv = 1,
                            name = climin.nodename,
                            label="Climate Index Calculation",
                            className = "ds:ClimateIndexCalculation"
                            )

      graph <- add_edges(graph, 
                         c(getNodeIndexbyName(graph, parentnodename),
                           getNodeIndexbyName(graph, climin.nodename)),
                         label = "ds:hadClimateIndexCalculation") 

      graph <- add_edges(graph, 
                         c(getNodeIndexbyName(graph, climin.nodename),
                           getNodeIndexbyName(graph, index.nodename)),
                         label = "ds:withClimateIndex")       
      nodenames<-append(nodenames, climin.nodename)
    }

    if(!is.null(data$fcst)){
      graph<-SunsetProv.Command(graph, package="Indices", version="2.0.0", fun="modules/Indices/Indices.R", arg.list=list("recipe"="Recipe","Data"="Data"), 
                                origin.node.name=nodenames)
      graph<-list("graph"=graph, "parentnodename"=list("parentnodename_fcst"=parentnodename_fcst, "parentnodename_hcst"=parentnodename_hcst
                                                    ))                                              
    } else{
      graph<-SunsetProv.Command(graph, package="Indices", version="2.0.0", fun="modules/Indices/Indices.R", arg.list=list("recipe"="Recipe","Data"="Data"), 
                                 origin.node.name=nodenames)
      graph<-list("graph"=graph, "parentnodename"=list("parentnodename_fcst"=parentnodename_fcst, "parentnodename_hcst"=parentnodename_hcst, 
                                                                     "parentnodename_obs"=parentnodename_obs))   
    }
    print(paste0("Indices provenance computed"))
    data$graph.prov<-graph
    return(data)
}    
