|
Home > Archive > Commerce Server General > January 2005 > Running pipelines in a Forms/Console application
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Running pipelines in a Forms/Console application
|
|
|
| Is there any way to run a pipeline in a C# Forms or console application?
I read in another post that you can't use the PipelineInfo class in a
non-web application. Is this true? If so, is there any other way to run a
pipeline from a non-web app?
I'm stuck creating orders in a batch process and I'd prefer not to have to
hit the web server if at all possible.
| |
| Sudha Raghavan [MSFT] 2004-12-13, 6:28 pm |
| The commerce Order context can only be obtained in a web application.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------
Thread-Topic: Running pipelines in a Forms/Console application
thread-index: AcTcy7ls9sWerKEmTxaLnQqU1cxOBA==
X-WBNR-Posting-Host: 168.230.130.248
From: "=?Utf-8?B?SmVycnk=?=" <Jerry@discussions.microsoft.com>
Subject: Running pipelines in a Forms/Console application
Date: Tue, 7 Dec 2004 18:15:02 -0800
Lines: 8
Message-ID: <D897EF18-B054-4A71-A25E-95D86B15E395@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.commerceserver.general
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0
3.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.commerceserver.general:15208
X-Tomcat-NG: microsoft.public.commerceserver.general
Is there any way to run a pipeline in a C# Forms or console application?
I read in another post that you can't use the PipelineInfo class in a
non-web application. Is this true? If so, is there any other way to run a
pipeline from a non-web app?
I'm stuck creating orders in a batch process and I'd prefer not to have to
hit the web server if at all possible.
| |
|
| That's not true. I can access the order context just fine (found that tidbit
in another posting). I am able to create and manipulate both baskets and
orders. The only thing I can't figure out how to do is run the basket and
totals pipelines on a new basket before I save it as an order.
"Sudha Raghavan [MSFT]" wrote:
> The commerce Order context can only be obtained in a web application.
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> You assume all risk for your use. © 2002 Microsoft Corporation. All rights
> reserved.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
> --------------------
> Thread-Topic: Running pipelines in a Forms/Console application
> thread-index: AcTcy7ls9sWerKEmTxaLnQqU1cxOBA==
> X-WBNR-Posting-Host: 168.230.130.248
> From: "=?Utf-8?B?SmVycnk=?=" <Jerry@discussions.microsoft.com>
> Subject: Running pipelines in a Forms/Console application
> Date: Tue, 7 Dec 2004 18:15:02 -0800
> Lines: 8
> Message-ID: <D897EF18-B054-4A71-A25E-95D86B15E395@microsoft.com>
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="Utf-8"
> Content-Transfer-Encoding: 7bit
> X-Newsreader: Microsoft CDO for Windows 2000
> Content-Class: urn:content-classes:message
> Importance: normal
> Priority: normal
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> Newsgroups: microsoft.public.commerceserver.general
> NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> Path:
> cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0
> 3.phx.gbl
> Xref: cpmsftngxa10.phx.gbl microsoft.public.commerceserver.general:15208
> X-Tomcat-NG: microsoft.public.commerceserver.general
>
> Is there any way to run a pipeline in a C# Forms or console application?
>
> I read in another post that you can't use the PipelineInfo class in a
> non-web application. Is this true? If so, is there any other way to run a
> pipeline from a non-web app?
>
> I'm stuck creating orders in a batch process and I'd prefer not to have to
> hit the web server if at all possible
| |
| Vinod Kumar[MSFT] 2005-01-14, 8:46 pm |
| If you want to run pipelines from the console application you should use OrderGroup.RunPipeline(pipeInfo, pipeline) method.
Here is some sample code for how to run pipelines from the console application.
PipelineInfo pipeInfo = new PipelineInfo(pipelineName);
//You'll need to manually configure the pipe context dictionary here.
//Here is some sample of configuring the message manager and cache manager.
// In this sample all caches are not configured so you'll need to configure all the caches in the cache manager.
CacheManagerClass cacheManager = null;
MessageManagerClass msgManager = null;
try
{
//Create the Cachemanager object
cacheManager = new CacheManagerClass();
//Create the Messagemanager object
msgManager = new MessageManagerClass();
msgManager.AddLanguage("en-US", 1033);
msgManager.AddMessage("pur_badsku", "One or more items were removed from the basket", "en-US");
msgManager.AddMessage("pur_noitems", "No items were found in the basket", "en-US");
msgManager.AddMessage("pur_badplacedprice", "Placed price was not correct", "en-US");
//Set the components in the dictionary
ConfigureCatalogSystem(pipeInfo, cacheManager);
ConfigureMarketingSystem(pipeInfo, cacheManager);
ConfigureOrderManagementContext(pipeInfo
, cacheManager);
pipeInfo["cachemanager"] = cacheManager;
pipeInfo["MessageManager"] = msgManager;
pipeInfo["CommerceResources"] = this.resources;
}
finally
{
if (cacheManager != null)
Marshal.ReleaseComObject(cacheManager);
if (msgManager != null)
Marshal.ReleaseComObject(msgManager);
}
//Like wise you'll need to configure the catalog system , Order system and campaigns system properties in the context dictionary.
PipelineBase pipeline = new OrderPipeline(pipelineName, pcfFilePath, false, logFilePath, false);
basket.RunPipeline(pipeInfo, pipeline);
I don't have the complete sample right now so give it a shot and if you've problems then get back to me.
Thanks
-Vinod
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved.
--------------------
Thread-Topic: Running pipelines in a Forms/Console application
thread-index: AcTiuWoFHAdF5dMHS9WwkoP44ZUloQ==
X-WBNR-Posting-Host: 168.230.130.248
From: "=?Utf-8?B?SmVycnk=?=" <Jerry@discussions.microsoft.com>
References: <D897EF18-B054-4A71-A25E-95D86B15E395@microsoft.com> <k7jBFKX4EHA.3388@cpmsftngxa10.phx.gbl>
Subject: RE: Running pipelines in a Forms/Console application
Date: Wed, 15 Dec 2004 07:19:04 -0800
Lines: 49
Message-ID: <732123B5-51DE-4E91-8F4B-5CF37150F5B9@microsoft.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 8bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.commerceserver.general
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.commerceserver.general:15248
X-Tomcat-NG: microsoft.public.commerceserver.general
That's not true. I can access the order context just fine (found that tidbit
in another posting). I am able to create and manipulate both baskets and
orders. The only thing I can't figure out how to do is run the basket and
totals pipelines on a new basket before I save it as an order.
"Sudha Raghavan [MSFT]" wrote:
> The commerce Order context can only be obtained in a web application.
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> You assume all risk for your use. © 2002 Microsoft Corporation. All rights
> reserved.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
> --------------------
> Thread-Topic: Running pipelines in a Forms/Console application
> thread-index: AcTcy7ls9sWerKEmTxaLnQqU1cxOBA==
> X-WBNR-Posting-Host: 168.230.130.248
> From: "=?Utf-8?B?SmVycnk=?=" <Jerry@discussions.microsoft.com>
> Subject: Running pipelines in a Forms/Console application
> Date: Tue, 7 Dec 2004 18:15:02 -0800
> Lines: 8
> Message-ID: <D897EF18-B054-4A71-A25E-95D86B15E395@microsoft.com>
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="Utf-8"
> Content-Transfer-Encoding: 7bit
> X-Newsreader: Microsoft CDO for Windows 2000
> Content-Class: urn:content-classes:message
> Importance: normal
> Priority: normal
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> Newsgroups: microsoft.public.commerceserver.general
> NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> Path:
> cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGXA0
> 3.phx.gbl
> Xref: cpmsftngxa10.phx.gbl microsoft.public.commerceserver.general:15208
> X-Tomcat-NG: microsoft.public.commerceserver.general
>
> Is there any way to run a pipeline in a C# Forms or console application?
>
> I read in another post that you can't use the PipelineInfo class in a
> non-web application. Is this true? If so, is there any other way to run a
> pipeline from a non-web app?
>
> I'm stuck creating orders in a batch process and I'd prefer not to have to
> hit the web server if at all possible
|
|
|
|
|