Genesys CTI User Forum

Genesys CTI User Forum => Genesys CTI Technical Discussion => Topic started by: Gautham on April 25, 2017, 08:04:35 AM

Title: Need help in workflow
Post by: Gautham on April 25, 2017, 08:04:35 AM
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
Title: Re: Need help in workflow
Post by: superman 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

Title: Re: Need help in workflow
Post by: Gautham 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
Title: Re: Need help in workflow
Post by: Kubig on April 25, 2017, 09:12:30 AM
Follow the documentation https://docs.genesys.com/Documentation/Composer/8.1.4/Help/DBDataCommonBlock#scrollNav-12
Title: Re: Need help in workflow
Post by: Gautham 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
Title: Re: Need help in workflow
Post by: Kubig 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).
Title: Re: Need help in workflow
Post by: Gautham 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
Title: Re: Need help in workflow
Post by: Gautham on April 26, 2017, 08:47:26 AM
Anyone please help me with the ecma script.
Title: Re: Need help in workflow
Post by: Kubig on April 26, 2017, 09:50:04 AM
What exactly is not working in your ECMA script or what is not clear?
Title: Re: Need help in workflow
Post by: Gautham 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
Title: Re: Need help in workflow
Post by: cavagnaro 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.
Title: Re: Need help in workflow
Post by: Kubig 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.
Title: Re: Need help in workflow
Post by: Gautham 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.