VMware Cloud Community
ajay009
Contributor
Contributor

how to pre populate data in input parameter while running workflow

Hi team,

     Am new to Vro tool and stuck . I dont know how to pre populate data on a input paramter when i run vro workflow. Any help please

22 Replies
Kaustubhambulka
Enthusiast
Enthusiast

Edit -> Workflow -> General tab

Add attributes

Select Type

Update Value for Attribute which you will be using in workflow

Add proper description.

Do not forget to use Attributes in Visual Binding.

Use : https://pubs.vmware.com/vsphere-60/topic/com.vmware.ICbase/PDF/vrealize-orchestrator-60-developers-g...

ajay009
Contributor
Contributor

Thank you for the reply Kaustubhambulkar.

Let me brief the situation.

          I need to store the result of ssh file in the input parameters. The ssh file is to return backup date from a server .ONLY DATE. So i need to store all the dates in two input parameters as two dropdown after running the workflow and before clicking on submit button.

     Please help me on this and i had been stuck for past two days. The ssh file returns all dates successfully if execute in the script but my requirement is to store the result as input parameter for a workflow for comparison.

Reply
0 Kudos
Burke-
VMware Employee
VMware Employee

Hello Ajay009,

  For what you are describing, you'll need to write an action that retrieves the backup dates and returns them as an array. You would then use that action to provide a Predefined list of elements that would populate your input field. For an example, take a look at my blog article: Dynamic Input Values Based on other Inputs  , scroll down to the section: Create a fidnUserByName Action and read from there.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
ajay009
Contributor
Contributor

Thank you Burke for your support.

    

     I stuck again in another segment. I cannot able to select the action which i created on properties. Can you help me out.

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

What is the return type of your action (the one you are trying to select)?

Reply
0 Kudos
ajay009
Contributor
Contributor

array is the return type

Reply
0 Kudos
ajay009
Contributor
Contributor

Here is the code which i included in the module

var sshCmd = ''

sshCmd += ' #!/bin/ksh \n';

sshCmd += 'PATH=$PATH:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin\n';

sshCmd += 'export PATH\n';

sshCmd += 'AsRoot="/opt/CA/AccessControl/bin/sesu -c"\n';

sshCmd += 'cd /var/tmp/SYSTEM_CONFIGURATION_DETAILS/ \n';

sshCmd += 'ls\n';

code = sshCmd;

var session = null;

var path;

var scriptStatus;

var exitString = '';

  System.log("Attempting to Login...");

  session = new SSHSession(servername, userName);

  session.setEncoding("");

     session.connectWithPassword(passWord);

  System.log("Logged in...");

  scriptStatus = session.executeCommand(code, true);

   output = session.getOutput();

  error = session.getError();

  exitCode = session.exitCode;

  session.disconnect();

   sshOutput=output;

  System.log("ExitCode:"+exitCode);

  return output;

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

There is no such type array; it should be array of something. Eg. on workflow1.png the the chooser is searching for actions with return type Array/string. Could you show a screenshot of vRO client showing the scripting tab of your action; near the top of it should be a field with the exact return type.

Also, are you sure the filter string you entered is correct? Does the chooser show other actions with return type Array/string if you remove the filter? There should be such actions coming fron ie. vCenter plug-in.

Reply
0 Kudos
ajay009
Contributor
Contributor

sorry it shows void

Reply
0 Kudos
Burke-
VMware Employee
VMware Employee

You need to change the return type from void to Array/string, assuming the input of your workflow is seeking a string.

Essentially, whatever the Input type is for a workflow, the return value of an array used to populate a dropdown list of values must be an array of that same type.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
iiliev
VMware Employee
VMware Employee

In addition to changing action's return type from void to Array/string, you will also need to change the scripting code a bit. Right now, you return output from SSH session, which is a single string; you will need to split this string into array of strings eg. by using split() method.

ajay009
Contributor
Contributor

thank you Ilian Iliev

    

     Made changes and am able to choose action then mapped to respective attribute to it.

     My doubt is "action" need three inputs to get it executed. So what i done is i created one presentation with three inputs and in second presentation am trying to print output of an action with the input in presentation 1 . Is that possible or am i going in right direction? Please guide me

Any help!!

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

What do you mean by this 'second presentation'?

Reply
0 Kudos
ajay009
Contributor
Contributor

display group

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

Yes, it is possible.

Let's say the 3 input fields in the first display group are of type string with names p1, p2 and p3, and the input field in the second display group which you want to populate with the result of action called on the first 3 fields is p4. You need to go to the presentation of the p4, add a presentation property Data binding, and configure its value to be the call of the action passing the p1, p2 and p3 as an inputs. So, the value of the Data binding property should look something like

GetAction("com.mycompany.mymodule","myaction").call( #p1 , #p2 , #p3 )

Now, if you launch the workflow and provide some values for p1, p2 and p3, you should see the value of p4 changing automatically with the result of applying the action over the other 3 inputs.

Data binding property is for dynamically changing the value of the dependent field; other presentation properties like Predefined answers / Predefined list of elements should also work.

Burke-
VMware Employee
VMware Employee

I must note that if you actually follow the blog article I posted earlier, I cover the use of the value of one field for another.. many things in this entire thread were addressed there.

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
Reply
0 Kudos
iancollins
Contributor
Contributor

Hi,

I am trying to do something very simialr and i have followed the blog artical you posted earlier.

I think i have done every thing right, but when i go to the Search action with result : Array/string, the search list is empty.

What did i miss?  I have attched a screen shot of the action and the search screens.

I have trashed everything twice and started again, and each time i get the same results.  I created a workflow to call the action and it returns the customerList array correctly.

Help please!!

Thanks

Ian....

Reply
0 Kudos
iiliev
VMware Employee
VMware Employee

Could you check vRO log files for errors around the same time you open action chooser?

The log files of interest are:

  • vRO client log - file name vso.log, located in the same folder on the client machine where the jnlp file used to start the client is.
  • vRO server log - file name server.log, located at /var/log/vco/app-server/ folder in vRO appliance
Reply
0 Kudos
iancollins
Contributor
Contributor

Hi Ilian,

There is nothing in the client log, but when i looked in the Server.log i found this (i tailed the log and tried the lookup and this was generated when i click the puzzle icon).

2017-04-21 15:47:08.967+0100 [http-nio-0.0.0.0-8281-exec-10] WARN  {} [SqlExceptionHelper] SQL Error: 8116, SQLState: S1000

2017-04-21 15:47:08.967+0100 [http-nio-0.0.0.0-8281-exec-10] ERROR {} [SqlExceptionHelper] Argument data type ntext is invalid for argument 1 of lower function.

2017-04-21 15:47:08.968+0100 [http-nio-0.0.0.0-8281-exec-10] ERROR {} [VcoDelegatingWebFacade] Server Error...

org.springframework.orm.jpa.JpaSystemException: could not extract ResultSet; nested exception is org.hibernate.exception.GenericJDBCException: could not extract ResultSet

        at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:314)

        at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:225)

        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:417)

        at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)

        at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)

        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

        at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:131)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)

        at com.sun.proxy.$Proxy288.findAll(Unknown Source)

        at com.vmware.o11n.service.query.QueryServiceImpl.findForQuery(QueryServiceImpl.java:45)

        at sun.reflect.GeneratedMethodAccessor1265.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:498)

        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)

        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)

        at com.sun.proxy.$Proxy304.findForQuery(Unknown Source)

        at com.vmware.o11n.service.factory.VcoFactoryFacade.findForQuery(VcoFactoryFacade.java:2005)

        at sun.reflect.GeneratedMethodAccessor1264.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:498)

        at com.vmware.o11n.service.security.AccessRightsInterceptor.invoke(AccessRightsInterceptor.java:97)

        at com.vmware.o11n.service.security.AccessRightsInterceptor.invoke(AccessRightsInterceptor.java:88)

        at com.vmware.o11n.service.webremoting.VcoDelegatingWebFacade.invokeOperation(VcoDelegatingWebFacade.java:106)

        at com.vmware.o11n.integration.initialization.VcoFactoryServiceFacadeProxy.invokeOperation(VcoFactoryServiceFacadeProxy.java:86)

        at sun.reflect.GeneratedMethodAccessor291.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:498)

        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)

        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)

        at com.sun.proxy.$Proxy10.invokeOperation(Unknown Source)

        at sun.reflect.GeneratedMethodAccessor11563.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:498)

        at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:212)

        at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:39)

        at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:78)

        at org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:114)

        at org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter.handleRequest(HttpInvokerServiceExporter.java:74)

        at org.springframework.web.context.support.HttpRequestHandlerServlet.service(HttpRequestHandlerServlet.java:67)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

        at net.sf.ehcache.constructs.web.filter.GzipFilter.doFilter(GzipFilter.java:95)

        at net.sf.ehcache.constructs.web.filter.Filter.doFilter(Filter.java:86)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)

        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614)

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)

        at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:676)

        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)

        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)

        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)

        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)

        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)

        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

        at java.lang.Thread.run(Thread.java:745)

Caused by: org.hibernate.exception.GenericJDBCException: could not extract ResultSet

        at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54)

        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)

        at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)

        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:91)

        at org.hibernate.loader.Loader.getResultSet(Loader.java:2066)

        at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1863)

        at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1839)

        at org.hibernate.loader.Loader.doQuery(Loader.java:910)

        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:355)

        at org.hibernate.loader.Loader.doList(Loader.java:2554)

        at org.hibernate.loader.Loader.doList(Loader.java:2540)

        at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2370)

        at org.hibernate.loader.Loader.list(Loader.java:2365)

        at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:497)

        at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:387)

        at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:236)

        at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1264)

        at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103)

        at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:573)

        at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:449)

        at org.hibernate.jpa.criteria.compile.CriteriaQueryTypeQueryAdapter.getResultList(CriteriaQueryTypeQueryAdapter.java:67)

        at org.springframework.data.jpa.repository.support.SimpleJpaRepository.executeCountQuery(SimpleJpaRepository.java:623)

        at org.springframework.data.jpa.repository.support.SimpleJpaRepository.count(SimpleJpaRepository.java:428)

        at com.vmware.o11n.service.repository.support.VcoCustomRepositoryImpl.findAll(VcoCustomRepositoryImpl.java:72)

        at sun.reflect.GeneratedMethodAccessor327.invoke(Unknown Source)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:498)

        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:483)

        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:468)

        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:440)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

        at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)

        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)

        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)

        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)

        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)

        ... 70 more

Caused by: java.sql.SQLException: Argument data type ntext is invalid for argument 1 of lower function.

        at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)

        at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)

        at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)

        at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671)

        at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505)

        at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1029)

        at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:82)

        ... 104 more

2017-04-21 15:47:08.969+0100 [http-nio-0.0.0.0-8281-exec-10] ERROR {} [VcoFactoryServiceFacadeProxy] ch.dunes.util.DunesServerException: could not extract ResultSet; nested exception is org.hibernate.exception.GenericJDBCException: could not extract ResultSet

I guess something is broken then?

Ian..

Reply
0 Kudos