property-set is not setting value - pega

I am trying to set 'emailid' value from table records into a property and then pass this property as input to 'To' in sendemailnotification method. When i run tracer, parameter is not being set, it is empty, so i get message saying atleast one emailid is required(to or cc or bcc).
I can see once the when rule in property-set is being validated, property values is not set, it is directly going to child item which is call sendemailnotification. 'To' is empty:

got this. Solved this by adding ".Emailid" also in the Obj-Browse.

Related

Spring MVC 2.5 Command object value is changed on form submit

I have a string variable in command object which is a hidden tag in my jsp.
An on click of a button i'm setting this variable with a value(example "test") and submitting the form.
On form submit, I get the control to my Validator.validate() method.
In this method the value of the variable in command object is changed that is comma is getting appended to the value(Example "test,").
I have checked debugging at the java script side, correct value is set to the variable there(it doesnt have the extra comma appended to it) but when it reaches the validator its value is changed.
I'm not understanding why only that particular variable value is getting changed while all other values are set correctly.
Please suggest how should i rectify this
Are there two form fields with the same name. When two form fields have the same name - the values could get appended in a list.

dynamodb creating a string set

I have a lot of objects with unique IDs. Every object can have several labels associated to it, like this:
123: ['a', 'hello']
456: ['dsajdaskldjs']
789: (no labels associated yet)
I'm not planning to store all objects in DynamoDB, only these sets of labels. So it would make sense to add labels like that:
find a record with (id = needed_id)
if there is one, and it has a set named label_set, add a label to this set
if there is no record with such id, or the existing record doesn't have an attribute named label_set, create a record and an attribute, and initialize the attribute with a set consisting of the label
if I used sets of numbers, I could use just ADD operation of UPDATE command. This command does exactly what I described. However, this does not work with sets of strings:
If no item matches the specified primary key:
ADD— Creates an item with supplied primary key and number (or set of numbers) for the attribute value. Not valid for a string type.
so I have to use a PUT operation with Expected set to {"label_set":{"Exists":false}}, followed (in case it fails) by an ADD operation. These are two operations, and it kinda sucks (since you pay per operation, the costs of this will be 2 times more than they could be).
This limitations seems really weird to me. Why are something what works with numbers sets would not work with string sets? Maybe I'm doing something wrong.
Using many records like (123, 'a'), (123, 'hello') instead of one record per object with a set is not a solutions: I want to get all the values from the set at once, without any scans.
I use string sets from the Java SDK the way you describe all the time and it works for me. Perhaps it has changed? I basically follow the pattern in this doc:
http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/API_UpdateItem.html
ADD— Only use the add action for numbers or if the target attribute is
a set (including string sets). ADD does not work if the target
attribute is a single string value or a scalar binary value. The
specified value is added to a numeric value (incrementing or
decrementing the existing numeric value) or added as an additional
value in a string set. If a set of values is specified, the values are
added to the existing set. For example if the original set is [1,2]
and supplied value is [3], then after the add operation the set is
[1,2,3], not [4,5]. An error occurs if an Add action is specified for
a set attribute and the attribute type specified does not match the
existing set type.
If you use ADD for an attribute that does not exist, the attribute and
its values are added to the item.
When your set is empty, it means the attribute isn't present. You can still ADD to it. In fact, a pattern that I've found useful is to simply ADD without even checking for the item. If it doesn't exist, it will create a new item using the specified key and create the attribute set with the value(s) I am adding. If the item exists but the attribute doesn't, it creates the attribute set and adds the value(s). If they both exist, it just adds the value(s).
The only piece that caught me up at first was that the value I had to add was a SS (String set) even if it was only one string value. From DynamoDB's perspective, you are always merging sets, even if the existing set is an empty set (missing) or the new set only contains one value.
IMO, from the way you've described your intent, you would be better off not specifying an existing condition at all. You are having to do two steps because you are enforcing two different situations but you are trying to perform the same action in both. So might as well just blindly add the label and let DynamoDB handle the rest.
Maybe you could: (pseudo code)
try:
add_with_update_item(hash_key=42, "label")
except:
element = new Element(hash_key=42, labels=["label"])
element.save()
With this graceful recovery approach, you need 1 call in the general case, 2 otherwise.
You are unable to use sets to do what you want because Dynamo Db doesn't support empty sets. I would suggest just using a string with a custom schema and building the set from that yourself.
To avoid two operations, you can add a "ConditionExpression" to your item.
For example, add this field/value to your item:
"ConditionExpression": "attribute_not_exists(RecordID) and attribute_not_exists(label_set)"
Source documentation.
Edit: I found a really good guide about how to use the conditional statements

Flex DataGridColumn with array of objects as data provider

I have a datagrid that uses an array of objects as the data provider. The objects are essentially key/value pairs:
{ foo:"something"}
{ bar:"hello"}
{ caca:"lorem"}
The datagrid has 2 columns. The first column is the key and the second column is the value. Right now my grid looks like:
My dataFormatter function makes sure that depending on the column (i.e. the dataField value) the correct key or value gets printed out. This works fine for displaying. However, as soon as I try and edit the value field it essentially adds a new value into the object with a key of '1'. For example, if I edit the {caca:"lorem"} object it will then contain the value {caca:"lorem",1:"new value"}.
Is there any possible way I can set the DataGridColumn so that when I edit a value it will update the value associated with the key rather than inserting a new value? I've tried using a custom item editor but it still does the insert. It seems like I need to be able to update the 'dataField' with the actual key value but I'm not sure how to do that.
Looks like you need to think about where your data is going to be stored. I would recommend listening for a CollectionEvent.COLLECTION_CHANGE event on your data model. That event object will contain info about what change occurred, and you can make any updates you need to make.

listbox selecteditem error

There have an error
"Object Reference not set to an
instance of an object"
when using objusername.intuserid=listbox1.selecteditem.value.
Check if listbox1.SelectedItem is null, or listbox1.SelectedIndex = -1 before accessing the property. This basically means nothing is selected.
Your ListBox1 can also return Text using SelectedValue property iff value has set to that before. But above is more effective way to get text.
Now, the value is something that is not visible to user but it is used mostly to store in database. We don't insert Text of ListBox1, however we can insert it also, but we used to insert value of selected item. To get value we can use
ListBox1.SelectedValue

How to set a default value to an destination schema element in BizTalk Map

I have a requirement in BizTalk map, where
I will map some elements from source schema to destination schema,where the values will be assigned to destination schema elements based on some condition.
If those values are not assigned, i need to send some default value (N/A).
My map is not One-to-One so that i can use a scripting functoid and send a default value, on top of that the destination schema is a flat file and in source schema i have to loop a lot.
So can any body give me some suggestion about "How to set a Default value to a Element in Destination schema if nothing is mapped" using BizTalk Map/some setting in schema.
What I have already tried is, I Opened the destination schema for all the elements I have set the value 'N/A' to a property -> "DefaultValue" which was there in the property tab but when nothing is mapped the default value is not coming. Instead the node itself is not created in the Output file.
Please see the Map below for a good understanding
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/0131.problem.JPG
Source Schema is a XML schema.
Destination Schema is a Flat file schema.
Now in the above map, in my source schema I am having a node called F4706 which will loop.
When the element "TypeAddressNumber" within the F4706 is "1", then I am mapping the remaining fields of that F4706 instance to "ship to" details in my destination schema
When the element "TypeAddressNumber" within the F4706 is "2",then I am mapping the remaining fields of that F4706 instance to "Reseller" details in my destination schema
When the element "TypeAddressNumber" within the F4706 is "3",then I am mapping the remaining fields of that F4706 instance to "EndUser" details in my destination schema
Now if I connect a Logical NOT functoid to the Logical Equal functoid and assign some default value, then the my destination node occurs Three times as one time the "=" functiod returns true one time and false other two times. But what I want is, if anything is there to map then map from "F4706" instance or assign the default value.
Find the INPUT File below
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/5430.ip.JPG
The output I'm expecting and getting is :
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/0724.curOP.JPG
Now if the Input file is like below :
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/6403.otherIP.JPG
That is when I don't have a "F4706" node with TypeAddressNumber=2, I need to fill "N/A" in Reseller related nodes in my destination schema, which should look like below :
alt text http://www.biztalkgurus.com/cfs-filesystemfile.ashx/__key/CommunityServer.Discussions.Components.Files/13/0435.nextOP.JPG
If you go and check the XLST which is getting generated, it is writing a xsl:foreach so if you use xsl:choose/otherwise conditions gets checked multiple times and my output nodes gets duplicated.
I also tried to use some global variable in XLST in First Loop and and second loop to access that and write the default value, unfortunately it doesn't work too. Because a VARIABLE in XLST is not a TRUE variable. I think its a CONSTANT.
How to accomplish this ANY help is highly appreciated.
Put two "Value mapping" (Label them "Incoming" and "Default") on the map and drag the output from both to your destination (you will get a warning at compile time).
Put a "Logical NOT" on the map (Label it "NoValue").
Put a logical evaluation (Existence, IsNil, Length) that suits your need, to evaluate if you have an incoming value, and drag your source field to it. (Label it "HasValue")
Drag the result to the "Incoming" and the "Logical NOT".
Drag your source field to the "Incoming".
Drag the output from "NoValue" to "Default".
Add a constant parameter to "Default", by double clicking and insert new parameter, that is your default value.
Hope you understand this mess :)
I believe you are essentially trying to control the creation of an output node based on some condition.
I have tried this for records (you are trying to do this for elements, so I believe this should work for that as well).
I had connected the output of the Logical functoid to the record and the record was created only if the logical functoid returned true.
For default values, you are doing it the right way by putting the default value in the property grid for Schema element. So if nothing is mapped to this element, you will see in the xsl file that the element with the default value is generated.

Resources