[gold-users] gdeposit and new allocation description

Scott Jackson scottmo at adaptivecomputing.com
Wed Dec 21 10:13:51 MST 2011


Kevin, 

The only problem you might run into is what is it going to do if you do not pass in a description? Is it going to have a problem with an unitialized value? I would probably only add the assignment if it is non-null/non-empty. You might also want to consider whether you want to add it to the case where you are depositing to an existing allocation to clobber the previous value. My thinking around this has been that any number of transactions might affect a single allocation (deposits, withdrawals, transfers, etc.) and that if they have descriptions for the transaction, they should go on the transaction instead of clobbering the description on the allocation. However, admittedly there is not an easy way to set the description when an allocation is created via a deposit (since I have disabled Allocation Create). 

Scott 

----- Original Message -----

> From: "Kevin Van Workum" <vanw at sabalcore.com>
> To: "gold-users" <gold-users at supercluster.org>
> Sent: Wednesday, December 21, 2011 7:58:43 AM
> Subject: [gold-users] gdeposit and new allocation description

> When using gdeposit to make a new allocation, I would like the new
> allocation's Description to be the description provided to gdeposit
> via the -d option. Currently the new allocation has no description,
> only the deposit's transaction. I have modified Bank.pm to do this,
> but was wondering if you could foresee any problems with this
> change? So far it seems to be working, but I haven't done anything
> close to a full test.

> [root at jman Gold]# diff -c Bank.pm.orig Bank.pm
> *** Bank.pm.orig 2011-12-21 09:52:46.000000000 -0500
> --- Bank.pm 2011-12-21 09:50:39.000000000 -0500
> ***************
> *** 4635,4640 ****
> --- 4635,4641 ----
> my $database = $request->getDatabase();
> my $dbh = $database->{_handle};
> my $amount = $request->getOptionValue("Amount");
> + my $description = $request->getOptionValue("Description");
> my $id = $request->getOptionValue("Id");
> my $allocation = $request->getOptionValue("Allocation");
> my $creditLimit = $request->getOptionValue("CreditLimit") || 0;
> ***************
> *** 4946,4951 ****
> --- 4947,4956 ----
> value => $creditLimit
> ),
> new Gold::Assignment(
> + name => "Description",
> + value => $description
> + ),
> + new Gold::Assignment(
> name => "Active",
> value => $activeness
> )

> --
> Kevin Van Workum, PhD
> Sabalcore Computing Inc.
> Run your code on 500 processors.
> Sign up for a free trial account.
> www.sabalcore.com

> 877-492-8027 ext. 11

> _______________________________________________
> gold-users mailing list
> gold-users at supercluster.org
> http://www.supercluster.org/mailman/listinfo/gold-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.supercluster.org/pipermail/gold-users/attachments/20111221/fcbc62ce/attachment-0001.html 


More information about the gold-users mailing list