Fix looping construct in NotifyAboutLowStock activity. Fix tests.

This commit is contained in:
Colin Kuskie 2009-12-08 19:00:23 -08:00
parent 3cb7970a91
commit af20594535
2 changed files with 7 additions and 2 deletions

View file

@ -98,7 +98,7 @@ sub execute {
my $warningLimit = $self->get('warningLimit');
my $finishTime = time() + $self->getTTL;
my $expired = 0;
PRODUCT: foreach my $product ($productIterator->()) {
PRODUCT: while (my $product = $productIterator->()) {
VARIANT: foreach my $collateral ( @{ $product->getAllCollateral('variantsJSON') }) {
if ($collateral->{quantity} <= $warningLimit) {
##Build message

View file

@ -35,7 +35,11 @@ my $posters = $import->addChild({
className => 'WebGUI::Asset::Sku::Product',
url => 'cell_posters',
title => "Red's Posters",
});
}, undef, undef, { skipAutoCommitWorkflows => 1, });
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->commit();
addToCleanup($versionTag);
my $ritaVarId = $posters->setCollateral('variantsJSON', 'variantId', 'new',
{
@ -74,6 +78,7 @@ my $workflow = WebGUI::Workflow->create($session,
mode => 'realtime',
},
);
addToCleanup($workflow);
my $threshold = $workflow->addActivity('WebGUI::Workflow::Activity::NotifyAboutLowStock');
$threshold->set('className' , 'WebGUI::Activity::NotifyAboutLowStock');