" /> Need help in workflow - Genesys CTI User Forum

Author Topic: Need help in workflow  (Read 3586 times)

Offline Gautham

  • Jr. Member
  • **
  • Posts: 62
  • Karma: -1
Need help in workflow
« on: April 25, 2017, 08:04:35 AM »
Advertisement
Hi Friends,

I am working on a workflow. In that i am trying to select data from a database by using data block.

steps followed:

1. Created a connection profile
2. Configured data block.
3. Tested it whether it is giving output.

The result is Customer name and Address. I am able to see the result in test wizard.

After DB block I am targeting agent in the workflow.

Now,I have to show this result to agent in WDE.

How to attach this information to agent?

Technically i am not able to assign the database output to the variable. How to assign customer name and address to the variables.

Kindly help me to achieve it.

Thanks,
Gautham

Offline superman

  • Newbie
  • *
  • Posts: 21
  • Karma: 0
Re: Need help in workflow
« Reply #1 on: April 25, 2017, 08:28:55 AM »
You have to create a business attribute first. Add the values you need to it. In your WDE object find the option named like format-business-attribute and set as value the name of your business attribute. For the data to appear, the attached data key names that you fill in your strategy must match the attribute value names of your business attribute.

Sent from my ONE A2005 using Tapatalk


Offline Gautham

  • Jr. Member
  • **
  • Posts: 62
  • Karma: -1
Re: Need help in workflow
« Reply #2 on: April 25, 2017, 09:05:09 AM »
[quote author=superman link=topic=10299.msg46791#msg46791 date=1493108935]
You have to create a business attribute first. Add the values you need to it. In your WDE object find the option named like format-business-attribute and set as value the name of your business attribute. For the data to appear, the attached data key names that you fill in your strategy must match the attribute value names of your business attribute.

Sent from my ONE A2005 using Tapatalk
[/quote]

The business attributes are configured properly. In composer used userdata block to match the keys. I am not facing any difficulty in this step. I am facing trouble to attach datablock output to the variables.

The output are customer name and address. I have created two variables like name and address. Have to map this two db output values to the variables. how to do that. Guide me.

tx
gautham

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2755
  • Karma: 44
Re: Need help in workflow
« Reply #3 on: April 25, 2017, 09:12:30 AM »
Follow the documentation https://docs.genesys.com/Documentation/Composer/8.1.4/Help/DBDataCommonBlock#scrollNav-12

Offline Gautham

  • Jr. Member
  • **
  • Posts: 62
  • Karma: -1
Re: Need help in workflow
« Reply #4 on: April 25, 2017, 10:30:38 AM »
[quote author=Kubig link=topic=10299.msg46794#msg46794 date=1493111550]
Follow the documentation https://docs.genesys.com/Documentation/Composer/8.1.4/Help/DBDataCommonBlock#scrollNav-12
[/quote]

Hi Kubig,

I have followed as per document only. Confused while assigning the DB output to the variables.

The outputs are ---->customer name and address.
variables names are---> name and address,

How to assign the output to variables.

I am using assign block to assign it. In variable field i have selected variable and what I need to give in expression field.

Tx
Gautham

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2755
  • Karma: 44
Re: Need help in workflow
« Reply #5 on: April 25, 2017, 11:45:58 AM »
All is described in documentation - see fragment below:

Results are stored in a variable as a two-dimensional JSON array. This data can then be accessed via a Looping block or via scripting in the Assign or ECMAScript block. For example, if the database result set looks like this in tabular form:

Vegetables Animals
lettuce chicken
broccoli lion
The JSON for the result will look like this: {"db_result":[["lettuce", "chicken"], ["broccoli", "lion"]],"db_result_columns":["vegetables", "animals"]}

So, all what you need to do is just write an ECMA script to read the returned values and assign them to any variables (existing or new ones).

Offline Gautham

  • Jr. Member
  • **
  • Posts: 62
  • Karma: -1
Re: Need help in workflow
« Reply #6 on: April 26, 2017, 05:45:45 AM »
[quote author=Kubig link=topic=10299.msg46799#msg46799 date=1493120758]
All is described in documentation - see fragment below:

Results are stored in a variable as a two-dimensional JSON array. This data can then be accessed via a Looping block or via scripting in the Assign or ECMAScript block. For example, if the database result set looks like this in tabular form:

Vegetables Animals
lettuce chicken
broccoli lion
The JSON for the result will look like this: {"db_result":[["lettuce", "chicken"], ["broccoli", "lion"]],"db_result_columns":["vegetables", "animals"]}

So, all what you need to do is just write an ECMA script to read the returned values and assign them to any variables (existing or new ones).
[/quote]
Hi Kubig,

Will u pls help me with any sample script.

Tx
Gautham

Offline Gautham

  • Jr. Member
  • **
  • Posts: 62
  • Karma: -1
Re: Need help in workflow
« Reply #7 on: April 26, 2017, 08:47:26 AM »
Anyone please help me with the ecma script.

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2755
  • Karma: 44
Re: Need help in workflow
« Reply #8 on: April 26, 2017, 09:50:04 AM »
What exactly is not working in your ECMA script or what is not clear?

Offline Gautham

  • Jr. Member
  • **
  • Posts: 62
  • Karma: -1
Re: Need help in workflow
« Reply #9 on: April 26, 2017, 01:22:52 PM »
[quote author=Kubig link=topic=10299.msg46811#msg46811 date=1493200204]
What exactly is not working in your ECMA script or what is not clear?
[/quote]

Hi Kubig,

I don't know how to create a ECMA script. can you help me with any sample ecma code that could be very helpful or me to finish this.

tx
Gautham

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7641
  • Karma: 56330
Re: Need help in workflow
« Reply #10 on: April 26, 2017, 01:47:10 PM »
You assign the output to a Variable, it is a JSON, then if variable is vData you get the properties:

vData.db_result.db_result_columns[0] for "vegetables".

Basic JScript, that is ECMA.

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2755
  • Karma: 44
Re: Need help in workflow
« Reply #11 on: April 26, 2017, 03:01:19 PM »
For more information about ECMA follow https://www.ecma-international.org/ecma-262/5.1/ or any other sources.

Offline Gautham

  • Jr. Member
  • **
  • Posts: 62
  • Karma: -1
Re: Need help in workflow
« Reply #12 on: April 26, 2017, 11:45:18 PM »
Project created and it is working as expected. tx Kubig and cavagnaro. Can't be possible without your help friends.