Fix looping construct in NotifyAboutLowStock activity. Fix tests.
This commit is contained in:
parent
3cb7970a91
commit
af20594535
2 changed files with 7 additions and 2 deletions
|
|
@ -98,7 +98,7 @@ sub execute {
|
||||||
my $warningLimit = $self->get('warningLimit');
|
my $warningLimit = $self->get('warningLimit');
|
||||||
my $finishTime = time() + $self->getTTL;
|
my $finishTime = time() + $self->getTTL;
|
||||||
my $expired = 0;
|
my $expired = 0;
|
||||||
PRODUCT: foreach my $product ($productIterator->()) {
|
PRODUCT: while (my $product = $productIterator->()) {
|
||||||
VARIANT: foreach my $collateral ( @{ $product->getAllCollateral('variantsJSON') }) {
|
VARIANT: foreach my $collateral ( @{ $product->getAllCollateral('variantsJSON') }) {
|
||||||
if ($collateral->{quantity} <= $warningLimit) {
|
if ($collateral->{quantity} <= $warningLimit) {
|
||||||
##Build message
|
##Build message
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,11 @@ my $posters = $import->addChild({
|
||||||
className => 'WebGUI::Asset::Sku::Product',
|
className => 'WebGUI::Asset::Sku::Product',
|
||||||
url => 'cell_posters',
|
url => 'cell_posters',
|
||||||
title => "Red's 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',
|
my $ritaVarId = $posters->setCollateral('variantsJSON', 'variantId', 'new',
|
||||||
{
|
{
|
||||||
|
|
@ -74,6 +78,7 @@ my $workflow = WebGUI::Workflow->create($session,
|
||||||
mode => 'realtime',
|
mode => 'realtime',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
addToCleanup($workflow);
|
||||||
|
|
||||||
my $threshold = $workflow->addActivity('WebGUI::Workflow::Activity::NotifyAboutLowStock');
|
my $threshold = $workflow->addActivity('WebGUI::Workflow::Activity::NotifyAboutLowStock');
|
||||||
$threshold->set('className' , 'WebGUI::Activity::NotifyAboutLowStock');
|
$threshold->set('className' , 'WebGUI::Activity::NotifyAboutLowStock');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue