Are there any listener in IMap which allow to get the name of the property which has been changed?
For example:
I have a map [{Key}, {"foo":"exampleFoo", "bar":"exampleBar"}], if something change in foo value, is there a way to get the name of the property?
Thanks for your support.
You can check the entry value by using entryEvent.getValue() in the EntryEvent parameter. Please remember to set includeValue parameter to true when you are adding the listener.
Related
I'm trying to change the value of a custom task using the Asana package for NodeJS. Sadly the official developer documentation appears to be out of date, because the updateCustomField method in the example is not valid anymore.
It looks like custom_fields can now be passed to the task.update method, but I run into 'Invalid request errors' when trying this.
Thanks!
It is indeed part of the task.update method. In the data for this method, you can set the custom_fields property to an object, where the key is the GID for the custom field you want to change and the value is the value you want to change to.
Which looks something like this:
client.tasks.update(taskID, {
custom_fields: {
"1234": "New value for field"
},
name
})
How can I check whether there is a specific parameter inside req.param() in sails.js?
For example, I want to check whether the parameter X_id exists in req.param(). If the parameter exists, then I want to use it. If it doesn't exist, then I want to use a default value instead. I've tried the following code:
X_owner: req.param('X_id') || -1,
But I receive an error when I run this code with out X_id parameter. How can I fix the code?
If you're aiming to use default values for your parameters, I'd suggest using actions2 if you haven't tried. It lets you define parameters (using the inputs' object) and use defaultsTo on inputs you want to have default values for, just like in your models attribute definitions. Using these should help resolve the issue.
As for how to check whether there is a specific parameter inside req.param(), you can use req.allParams() to reveal all current parameters from all sources. These include parameters parsed from the url path, the request body, and the query string in that order.
This is my first attempt to use MSXML2.DOMDocument within VBA, and I'm having a "huh?" moment right off the start. My document looks like this...
<Locations>
<Location ID="23456">
<Properties>
<Property ID="12345">
etc.
I want to make a report with all the Location IDs, so I:
Set locs= XDoc.SelectNodes("//Location")
For Each loc In locs
Debug.Print loc.Attributes(0).Text
Next
and I got 23456. Yay! But of course, those attributes might move around, so let's fix that...
Debug.Print loc.getAttribute("ID").Text
That returns Object required. Looking in the debugger, I can see that loc has one attribute and it's name is ID. That seems right. I can also see that loc.getAttribute("ID") returns null. That seems wrong.
So what's going on here?
I don't know VBA at all but my guess would be that the .attributes[] property returns an attribute object (XmlAttribute?), which would let you access its identifier and value, whereas the getAttribute() function is the getter for the text value of the attribute with that identifier.
Query on console
User.select('email','dob')
returns,
[#<User:0x000000084a9b08 id: nil, email: "xyz#zyx.com">,
Why am I getting id attributes in rails 4? How to get rid of this?
Pluck only returns the values if you want keys and values then
try this:
User.select('email','dob').as_json(:except => :id)
In my case the desired result was a JSON object. So, inside the as_json method
you can exclude any column you desire
(additionally you can invoke object methods or access associated tables as well)
This will give you desired output
User.pluck(:email, :dob)
I am getting below error when I run the Orchestration and try to assign value to a promoted property by reading the value of another promoted property.
Error in Suspended Orchestration:
Inner exception: There is no value associated with the property BankProcesses.Schemas.Internal_ID' in the message.
Detail:
I have 2 XSD schemas, 1 for calling a stored procedure and reading its response and another to write it into a flat file. The internal ID returned in the response from SP needs to be passed to a node in another XSD schema to write to a flat file format.
I have promoted an element from the response schema and also promoted an element from the schema to write to flat file. I am assigning the value to promoted propeties as below:
strInternalId = msgCallHeaderSP_Response(BankProcesses.Schemas.Internal_ID);
msgCallSP(BankProcesses.Schemas.Header_Internal_ID) = strInternalId;
But when I run the orchestration I get the error as mentioned above. I have checked the reponse from stored procedure and the reponse XML does contain some value but I am unable to assign that value to another schema. Please advice
Thanks,
Mayur
You can use exists to check the existence of property.
if(BankProcesses.Schemas.Internal_ID exists msgCallHeaderSP_Response)
{
strInternalId = msgCallHeaderSP_Response(BankProcesses.Schemas.Internal_ID);
msgCallSP(BankProcesses.Schemas.Header_Internal_ID) = strInternalId;
}
One scenario that might cause this error is that there is no Header_Internal_ID element in the message you are trying to modify. Can you inspect the message before modification to ensure that there is an element whose value should be changed - drop the message out to a file location, maybe.
If this is the case, then just ensure that you create this element when you instantiate you r message for the first time - even if you initially set it to an empty element.
HTH
To check if the property exists, you can use this syntax:
BMWFS.LS.BizTalk.CFS.BankProcesses.Schemas.Internal_ID exists msgCallHeaderSP_Response
However, if the case is that the source field would always be there, you have to work backwards to find out why the Property is not appearing on the Context.
If it's coming from a Port, is the message passign through an XmlDisassembler Component? If it's coming from another Orchestration, are you actually setting the Property?
The easiest way to look at the Context is to route the Message, msgCallHeaderSP_Response, to a Stopped Send Port. You can then view the Context in BizTalk Administrator.