I have a SKNode that is running different actions.
Depending on the running action I want to trigger other behaviours. For that I would need to find out how to check which action is currently running on my SKNode.
I know of .hasActions() but this is returning a general true/false value, which does not help me in my situation.
Does anyone have a better solution?
Thanks in advance
When you start running an action, you assign a key to it using this method:
yourNode.run(someAction, withKey: "someKey")
You can then get the action with your key using:
yourNode.action(forKey: "someKey")
If the above cal returns nil, that means the node is not running the action!
Related
I have added the following code in the WebApplet_Load of Service Request Applet.It's giving me the above error once, I tries to open the SR screen from the application.
try
{
var currBC = this.BusComp();
with (currBC)
{
ActivateField("Restrict_drop_down");
ClearToQuery();
//BC.SetViewMode(3);;
TheApplication.SetProfilAttr("SR Type", GetFieldValue("Restrict_drop_down"));
ExecuteQuery(ForwardBackward);
}
}
catch (e)
{
TheApplication().RaiseErrorText(e.errText);
}
Any idea on how to solve the issue?
You cannot do GetFieldValue when the BC is in Query mode. You have just done ClearToQuery, so you have to execute the query first, check for FirstRecord(); and then do a GetFieldValue();
Also, during the WebApplet load the first BC query is not finished running. It might not be the best place to write this code.
Please check with a siebel expert on your team, such kind of code needs to be placed carefully.
I need to intercept my loopback queries before they query my Mongodb to add additional filters, for example, to limit the object to what the user has access to.
I can successfully update the query on access operation hook to add filters to the GET /Applications , where Applications is my object. However This fails to work for GET /Applications/count
The command runs with a 200, however it returns zero results, even though I'm adding the exact same filters. There most be something different about count that I'm missing. The ctx object looks have a ton of functions/objects in it. I'm only touching the query property, but there must be something else I need to do.
Any ideas? Thank you, Dan
Could you please share your access hook observer's implementation. I tried it on a sample app, and following access hook works as expected for /api/Books/count:
module.exports = function(Book) {
Book.observe('access', function logQuery(ctx, next) {
ctx.query.where.id = 2; // changing filter value for where
console.log('Accessing %s matching %j', ctx.Model.modelName, ctx.query.where);
next();
});
};
Verify that you're modifying query property of Context (see access hook).
Hope that helps.
I'm building an ember app, and I keep running into the same problem where I make a call to the store, but the function keeps compiling before the store has retrieved the data from the backend. Specifically I'm having the problem with a findRecord. I've implemented it both ways:
var admin = this.store.findRecord('admin', 1);
console.log(admin.get('season'));
console.log('Are we here?');
and
this.store.findRecord('admin', 1).then(function(admin) {
console.log(admin.get('season'));
});
console.log('Are we here?');
In both cases, the Are we here? is logged BEFORE the season. Obviously the console logs are just for the example, and it creates an actual problem with what I'm trying to get done. Does anybody know a simple fix for this delay?
Thanks.
Of course it is. It's an asynchronous behavior. It takes some time to solve promise which is returned from findRecord(), thus the consequence is:
this.store.findRecord(); //synchronous
console.log('we are here'); //synchronous
in the meantime a promise returned from findRecord() gets resolved (asynchronous behavior)
console.log(admin.get('season'));
An asynchronous call will not stop your code from progressing, that´s the purpose of it. Else it would block UI updates and user interaction while loading data.
I would like to turn on the audit logging with a wsadmin script. I was able to create the audit notification like this:
AdminTask.createAuditNotification('[-notificationName Log_Notification -sendEmail false -emailList -logToSystemOut true ]')
But I can't create the auditnotification monitor, becasuse it needs to have the notificationRef:
AdminTask.createAuditNotificationMonitor('[-monitorName AuditMonitor -notificationRef WSNotification_1428567470299 -enable true ]')
and if I want to get that ref (AdminTask.getAuditNotificationRef()) to put it in a variable, then it needs to have the monitor configured first (according to the IBM documentation). If I do not configure the notification monitor first, then the getAuditNotificationRef will return with null value. But if I want to configure the monitor, I need the notificationRef :(.
Kind of confusing stuff for me...could anyone help me with this issue?
thanks
Have you looked in the knowledgecenter?
http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/txml_7auditnotify.html?lang=en
This shows the following example:
AdminTask.createAuditNotification('-notificationName defaultEmailNotification
-logToSystemOut true -sendEmail true -emailList administrator#mycompany.com(smtp-server.mycompany.com)
-emailFormat HTML')
AdminTask.createAuditNotificationMonitor('-notificationName defaultEmailNotification
-logToSystemOut true -sendEmail true -emailList administrator#mycompany.com(smtp-server.mycompany.com)
-emailFormat HTML')
AdminConfig.save()
As you can see, there is no -notificationRef needed.
Regards,
Gary
After upgrading my .NET server and client projects to 4.0 RC
I get NullReference exceptions because my custom State object is null.
I instantiate the state property in OnOpen event handler, but inside the method body of the first call it is already null.
I have checked in debugger and see that this.GetHashCode() returns different values
in OnOpen event handler and in method, which means it is a different instance.
Is it a known issue? I assume it is very basic behavior and probably I have missed something during upgrade to new version.
Thanks in advance.
I managed to understand the problem. It happens when using PluginAlias.
[XSocketMetadata(PluginAlias =
When attribute is removed and client uses full controller name everything works as expected
and GetHashCode returns same id.
I pushed the replication code to GitHub:
https://github.com/amichel/PlayWithXSockets/tree/ReproduceBugs
When using alias there is a bug (as you have found out).
The workaround is to either use the class name of the controller or only have alias in lower casing.
In your case using
[XSocketMetadata(PluginAlias = "test")]
would work.
Regards
Uffe