uProduce Data Sources and Recipient Tables

680 views
Skip to first unread message

Automation

unread,
May 13, 2012, 3:57:21 AM5/13/12
to XMPie Interest Group
Hi All,

Can anyone give me some ideas and sample code for the following.

I have written code to automate adding production jobs into uproduce
and via csv data files.

I create my data source and then use the call
createnewticketfordocument....

As I have made sure each document has only 1 data source and this has
only 1 recipient table within this
I dont have to set this in code as this in the only 1 it can use.

I have recently added dbf to the data I will be reading into the
system.

So really I am going from knowing I have only 1 data source and
recipient table to wanting to have many in the
campaign and want to select the correct one each time I output.

I need to know when I call createnewticketfordocument how I can set a
specific data source from many
that maybe against the document and then set a specific recipient
table.

I have noticed that with my csv files, when I look at the recipient
table names in uproduce drop down list
i have a # in the table name? not sure if this was causing me
problems.




Guillaume Besnier

unread,
May 13, 2012, 12:00:17 PM5/13/12
to xmpie...@googlegroups.com, Automation
With Campaign.GetDataSources, you can retrieve the list of existing Data
Sources in your campaign.
With DataSourcePlanUtils.GetCompatibleTables, you can retrieve the list
of only those tables, which are compatible with the schema described in
your plan.
Selecting the appropriate one (should several be compatible at a given
time) cannot be done by XMPie, but must be "decided" by your user or own
application, based on criteria of your own choice.
Then, JobTicket.SetDataSource and JobTicket.SetRI may be used to
specify, which actual table will be used.
Then, Production.SubmitJob would submit the job, as you certainly
already do.

-------- Message original --------
Sujet: [xmpie-users] uProduce Data Sources and Recipient Tables
De : Automation <paulnew...@hotmail.com>
Pour : XMPie Interest Group <xmpie...@googlegroups.com>
Date : 13/05/2012 09:57

Automation

unread,
May 14, 2012, 11:59:36 AM5/14/12
to XMPie Interest Group
Hi,

Thanks for your reply

I have used the JobTicket.SetRI and this seems to be working fine.

When trying to use JobTicket.SetDataSource I need "inSchemaName"
parameter?

The only schema name I have in the plan is called schema?

What do I need this parameter to be?

Thanks



On May 13, 5:00 pm, Guillaume Besnier <guillaume.besnier...@gmail.com>
wrote:
> With Campaign.GetDataSources, you can retrieve the list of existing Data
> Sources in your campaign.
> With DataSourcePlanUtils.GetCompatibleTables, you can retrieve the list
> of only those tables, which are compatible with the schema described in
> your plan.
> Selecting the appropriate one (should several be compatible at a given
> time) cannot be done by XMPie, but must be "decided" by your user or own
> application, based on criteria of your own choice.
> Then, JobTicket.SetDataSource and JobTicket.SetRI may be used to
> specify, which actual table will be used.
> Then, Production.SubmitJob would submit the job, as you certainly
> already do.
>
> -------- Message original --------
> Sujet: [xmpie-users] uProduce Data Sources and Recipient Tables
> De : Automation <paulnewman_1...@hotmail.com>

Guillaume Besnier

unread,
May 15, 2012, 12:44:46 AM5/15/12
to xmpie...@googlegroups.com
You are right: it eventually appears I rarely use
JobTicket.SetDataSource myself.

Prefer simply using JobTicket.SetRI, with a Connection object provided
by DataSource.GetConnection (which will kindly specify the connection to
the relevant DataSource).

Attached is a simple snippet.

-------- Message original --------
Sujet: [xmpie-users] Re: uProduce Data Sources and Recipient Tables
De : Automation <paulnew...@hotmail.com>
Pour : XMPie Interest Group <xmpie...@googlegroups.com>
Date : 14/05/2012 17:59
Program.cs

Automation

unread,
May 15, 2012, 4:49:31 AM5/15/12
to XMPie Interest Group
Hi,

Again Thanks for your time.

I have the code working for txt file but not FOXP tables.

I have an error of

Failed to connect to the database using:
ADO ERROR: Not a valid file name.

I can see you are having to transfer connection information from
datasource level
to job ticket level.

My code is below, this snippet doesnt show I have previously created a
datasource called "Daily Data" and connection string to the
TESTFILE.DBF


// Create the job ticket web service
object
JobTicket.JobTicket_SSP jobTicketWS =
new JobTicket.JobTicket_SSP();

// Create a new job ticket
string jobTicketID =
jobTicketWS.CreateNewTicketForDocument(uName,
password,
strcdoc_id, "", false);

///////////////////// new


// Set recipient list
JobTicket.RecipientsInfo riInfo = new
JobTicket.RecipientsInfo();
riInfo.m_Filter = FileName; ----
TESTFILE.DBF
riInfo.m_FilterType = 3;

JobTicket.Connection conn = new
JobTicket.Connection();
conn.m_ConnectionString = ConStr;
conn.m_Type = strcdstype; --FOXP
conn.m_AdditionalInfo =
AdditionalConn; ---- TESTFILE.DBF

DataSource.Connection connds =
dataSourceObj.GetConnectionInfo(
uName,
password,
dataSourceID);

conn.m_ConnectionString =
connds.m_ConnectionString;
conn.m_Type = connds.m_Type;
conn.m_AdditionalInfo =
connds.m_AdditionalInfo;

jobTicketWS.SetRI(uName, password,
jobTicketID, riInfo, conn);





On May 15, 5:44 am, Guillaume Besnier <guillaume.besnier...@gmail.com>
wrote:
> You are right: it eventually appears I rarely use
> JobTicket.SetDataSource myself.
>
>  Program.cs
> 3KViewDownload
>
> Prefer simply using JobTicket.SetRI, with a Connection object provided
> by DataSource.GetConnection (which will kindly specify the connection to
> the relevant DataSource).
>
> Attached is a simple snippet.
>
> -------- Message original --------
> Sujet: [xmpie-users] Re: uProduce Data Sources and Recipient Tables
> De : Automation <paulnewman_1...@hotmail.com>
> >>> problems.- Hide quoted text -
>
> - Show quoted text -

Automation

unread,
May 15, 2012, 5:43:50 AM5/15/12
to XMPie Interest Group

Hi,

Another thing I have noticed is that my jobs display the following in
the "Job center details" under Recipients:

Recipient Information: recipients data source (no details)Table Name:
999999_COR818_10052012.DBF; From Record: 1; To Record: 5

It has no data source displayed just a recipient .dbf or .csv file.

The csv files work fine like this but table do not and error with the
error:

Failed to connect to the database using:
ADO ERROR: Not a valid file name.

Its like im missing the data source against the jobticket?

Guillaume Besnier

unread,
May 15, 2012, 1:30:54 PM5/15/12
to xmpie...@googlegroups.com, Automation
I also see this "(no details)" message (uProduce 5.3.2) but this does
not prevent me in any way from successfully submit and compose my job,
even with a CSV data source.

Did you retrieve the selected data source connection throught
DataSource.GetConnection, then use this Connection structure as a
parameter to your JobTicket.SetRI?

What table name did you retrieve through PlanUtils.GetCompatibleTables?

Should you dump the contents of your retrived Connection, what kind of
information have you got?

-------- Message original --------
Sujet: [xmpie-users] Re: uProduce Data Sources and Recipient Tables
De : Automation <paulnew...@hotmail.com>
Pour : XMPie Interest Group <xmpie...@googlegroups.com>
Date : 15/05/2012 11:43

Jimbo

unread,
Apr 22, 2015, 9:15:43 AM4/22/15
to xmpie...@googlegroups.com
Thanks Bill for the sample source.  Helped me greatly.  I see a potential for concurrency issues.  Guess I'll worry bout that later.

Your source saved me a lot of time.  Hopefully I can pay it forward at some point.
Reply all
Reply to author
Forward
0 new messages