I have a jump-to which "jumps to a response" on a previous node. That previous node was setting some context and responding.
I expect that my jump-to which is configured to "jump to the response only" should only respond and not try to set context again..
I am seeing that the jump is also trying to set the same context on the previous node before responding.Is that the expected behaviour?
Yes. It is the expected behaviour .Jump to Respond will set the context variables as well as give the response without checking the condition
Related
I am using Quickfixj 2.3 for initiator. Vendor party is acceptor .
I have implemented SessionStateListener with the methods onConnectException and OnDisconnect.
I have resetOnLogon =Y in configuration file .
How can I catch specific exception like EndOfStream occurred ,due to wrong session data or due to acceptor allows only one session at a time or due to invalid Msg seq ?
Now, when the resetOnLogOn=Y,until the msgSeq satisfies, it keeps internally the disconnecting and initiating. I would like to logout manually in all other disconnects except this situation where it auto matches the seq number .
Thank you .
You actually cannot tell the scenarios listed in point 1 apart most of the time.
E.g. the counterparty normally will not tell you if you have wrong session data (I assume you mean wrong SenderCompID or TargetCompID) because that would disclose information about their system. Same goes for the duplicate session.
Only in the case of a "sequence number too low" event the counterparty normally will send this information in the 58/Text field of the Logout message.
I have a configuration setup with two CAN nodes and an attached database. I have added a CANOEILNLVECTOR.dll to both the nodes. By adding this Dll file all my messages are sent cyclic as I see in trace window.
Now I set some value for a signal in a message, For Eg:
variables
{
message Battery_Traction Batt_msg;
}
on start
{
Batt_msg.Isolation_Signal = 0x02; //0x02:On
output(Batt_msg);
}
What I see on trace is: The message is cyclic but only for the first instance the value set by me above appears in trace. For all of the rest times the signal value in the message in set to default.
As seen in the image value 0x02 is sent only once.
I am not sure what could be the problem, as seen in image attached value set by me is only sent once.
When using output you are putting the message directly onto the CAN bus, but you are not changing the value inside of your (simulated) node, so the interaction layer is still sending the old value.
You can change the signal value in the interaction layer by just putting a $ in front of the signal name and set the value.
In your case most likely $Isolation_Signal = 0x02
Outputting the message on the CAN bus at the right time, with the right cycle time and so on will be handled by the interaction layer.
You have two ways to influence dynamically the value of your message: IL DLLs and custom message sending.
Custom message sending is the basic way, where
you define the message ex.: message Battery_Traction Batt_msg;
you trigger its sending(output function)
you set up cyclic sending on timer Cycletimemsg1 {output(msg1);}
and so on.
IL DLLs are doing this all for you, without much coding effort from your side, but they rely heavily on the dbc settings and attributes you have linked as database to your CAN Channel.
Unfortunately, they don't play well together, meaning you need advanced CANoe know-how of them to use both in the same environment. You basically bypassed your CANOEILNLVECTOR.dlls working by sending explicit message.
So your code if you are accessing your signal through IL, should look like this:
variables
{
/*no need to define custom message object, they are already "known" to IL by dbc*/
}
on start
{
$Batt_msg::Isolation_Signal = 0x02; //0x02:On
/*NO need for output either (IF YOUR MESSAGE IS defined Cyclic in dbc), */
}
If your signal is not identified at $Batt_msg::Isolation_Signal, just dragndrop the signal from the CAPL browsers Symbols panel, and add the $ sign before it.
Through dollar($) sign, you access the dbsignal class objects signal value attribute.
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at CompangleComplete_fla::MainTimeline/loop()[CompangleComplete_fla.MainTimeline::frame119:205]
I got this error.
When the player touch the "black rectangle", supposed to move to the next scene.
I try to check where is the problem, then I try this
if(endpoint==false){
if(player.hitTestObject(back.other)){
endpoint==true;
trace("next scene");}
the code run without error.
But then I try this,
if(endpoint==false){
if(player.hitTestObject(back.other)){
endpoint==true;
gotoAndPlay(2, "Scene 9");}
I got error like above.
The code for my gotoAndPlay(2, "Scene 9") is wrong. How I should change it?
There appears to be a method loop() being executed repeatedly. My guess is that Scene 9 does not contain one of the objects referenced in that loop. You can pinpoint the specific line of code by debugging the movie within Flash (ctrl + shift + enter).
Without more code it is hard to determine exactly what you are doing, but if you must change scenes I recommend stopping any loops/ENTER_FRAME listeners first, then starting them again in the new scene.
I am doing some experimentation to try to learn about GameKit and I made a simple game and an interface which lists my player's matches. I am trying to add the ability to remove games using the removeWithCompletionHandler: method on the match, but I am having trouble removing a GKTurnBasedMatch which seems to have entered an invalid state.
A po of the match in question prints:
$0 = 0x1d590d20 <GKTurnBasedMatch 0x1d590d20 id:858d8257-cc49-4060-b1d8-38c09a929e3c status:Ended message: taken:2013-03-08 18:08:47 +0000 created:2013-03-08 03:24:14 +0000
current:<GKTurnBasedParticipant 0x1d58c020 - id:G:1717956303 (local player) status:Invited outcome:None lastTurn:(null)>
participants:
<GKTurnBasedParticipant 0x1d58bc90 - id:G:1717239488 status:Done outcome:Quit lastTurn:2013-03-08 18:08:47 +0000>
<GKTurnBasedParticipant 0x1d58c020 - id:G:1717956303 (local player) status:Invited outcome:None lastTurn:(null)>
>
Which seems to indicate that the match has been ended. However, one of the participants has the outcome:None, which I am led by the docs to believe is invalid for an ended game. Trying to simply remove the game gives:
The requested operations could not be completed because one or more parameters are invalid.
While trying to set the outcomes and end the game gives:
The requested operation could not be completed because the session is in an invalid state.
I thought perhaps I could not remove the game because the local player is the active participant, but both participantQuitInTurnWithOutcome:... and endTurnWithNextParticipants:... both give the error:
The requested operation could not be completed because the session is in an invalid state.
as well. Am I doing something wrong or did I somehow create an unremovable game?
P.S. I am also unable to remove the games through the Game Center provided interface, where they are listed under the "Game Over" section.
This is how I managed to remove all invalid matches.
I checked the status of the current participant, if it's invited, I called declineInviteWithCompletionHandler, otherwise I called participantQuitInTurnWithOutcome.
In both completion blocks, I then called removeWithCompletionHandler to remove the match.
This generated a few errors but the matches were still removed so my list is clean.
And here is a workaround on how to avoid getting to this state to begin with. This has the added benefit that the invitee never even get a notification if the inviter quits before finishing his/hers first turn.
In playerQuitForMatch, first end the turn and then in the completion handler, immediately quit the match. Like so,
[match endTurnWithNextParticipants:[NSArray arrayWithObject:nextParticipant]
turnTimeout:GKTurnTimeoutDefault
matchData:nil completionHandler:^(NSError *error) {
if (error) {
NSLog(#"%#", error);
}
[match participantQuitOutOfTurnWithOutcome:GKTurnBasedMatchOutcomeQuit
withCompletionHandler:^(NSError *error) {
if (error) {
NSLog(#"%#" ,error);
}
}];
}];
Unfortunately, I've run into the exact same error. To help others understand the problem, in hopes of researching a solution, you can recreate this by inviting a friend to a match, but then quitting the match during the first turn before you ever submit that turn to the invited player. Then, the hosting player removes the match from Game Center. On the invited player's device, they will have a match that looks like the one referenced above, that cannot be deleted. I've tried all types of workaround solutions.
I haven't had any luck yet, but I will update my answer with a solution if I find one. I'm currently trying to ship a Game Center game and so I have to find some way around this. I'll have a conclusion within the next day or two.
UPDATE:
I went over my non-deleteable matches, and they are almost the same as yours except my player with the Invited status also has the match outcome of Won. It seems the key to put the match into an invalid state is to have one player status be Invited instead of Done, but have the match status be Ended. That's the common element between our two cases, and it's an edge case in Apple's bizantine Game Center code. It wouldn't surprise me if they simply screwed up this edge case and expected you to "just know" that you weren't supposed to put the players in that state (undoubtedly if you read their docs closely enough you'll be able to piece this together eventually).
My conclusion is that Apple has an edge case on their hands that goes unnoticed easily because it only can happen if you quit a new match, and only if you invite a friend, two cases you might not test often. Also, if you aren't setting match outcomes improperly I'm guessing it will never happen so they just never caught it.
Since I haven't shipped yet, I'm going to configure my app to detect matches in this state and ignore them. I'm going to report to the console a count of how many matches are in this state, just so I can ensure its not growing past this point. Then, I'm going to analyze my quitting code and make sure that in this edge case that I simply can never put a match into this state again. I think given what we know we've got to be proactive, and just suck up the fact that some matches slipped through.
Hopefully you haven't shipped yet, so the error case matches will be localized to the Game Center Sandbox environment. Actually, the bad matches are just localized to your test user in the Sandbox, so you could just throw away that user and start with a new user once you've corrected your issue. If you implement my above suggestions you should be able to confirm your app is working properly before taking this step.
If anyone can actually find a way to remove these error matches once they exist, please let us know, but I hope my suggestions and identification of the actual cause will be enough to help you proceed with your project.
I found the solution. For invalid matches just use -participantQuitOutOfTurn method and then -removeWithCompletionHandler method. It will be completely removed.
I have a similar situation, if slightly different. I start a match, invite a second sandbox account to play, then the first player quits and deletes the game before the second player can respond. When the second player tries to then quit the game, they get this error:
Error quitting match in turn: Error Domain=GKErrorDomain Code=22 "The requested operation could not be completed because the specified participant is invalid."
UserInfo=0x1f5de800 {
GKServerStatusCode=5097,
NSUnderlyingError=0x1f58b610 "The operation couldn’t be completed.
status = 5097,
Invalid state: turn sent to playerId:1952436619 in slotIndex: 0 for sessionId: 698b074b-fa0b-4505-834f-1b4305b7eecb : expected slot state: Active but found: Inactive",
NSLocalizedDescription=The requested operation could not be completed because the specified participant is invalid.
}
So as far as I can tell, that's happening because the next participant to move already has a status of "Done," which I'm guessing is because they already quit:
<GKTurnBasedMatch 0x1f532b20 id:698b074b-fa0b-4505-834f-1b4305b7eecb status:Open message: taken:2013-03-30 19:53:47 +0000 created:2013-03-30 18:29:09 +0000
current:<GKTurnBasedParticipant 0x1f532b80 - id:G:1952433332 (local player) status:Active outcome:None lastTurn:2013-03-30 19:53:47 +0000>
participants:
<GKTurnBasedParticipant 0x1f532b70 - id:G:1952436619 status:Done outcome:Lost lastTurn:2013-03-30 18:29:10 +0000>
<GKTurnBasedParticipant 0x1f532b80 - id:G:1952433332 (local player) status:Active outcome:None lastTurn:2013-03-30 19:53:47 +0000>
>
Hopefully this will help others diagnose if nothing else. Would love to hear others' insights towards a workaround or solution. If this is a bug on Apple's part, it seems like it might be worth filing a radar.
Apple Technical Developer support confirmed the issue. Submitted bug report. Will keep you posted.
I'm using Polly to retry web service calls in case the call fails with WebException, because I want to make sure the method executed correctly before proceeding. However sometimes web methods still throw exception even after retrying several times and I don't want to retry forever. Can I use Polly to show some confirmation dialog, e.g. "Max retry count reached! Make sure connection is enabled and press retry." Then retry counter should reset to initial value and start again. Can I achieve this using only Polly or should I write my own logic? Ideas?
Polly has nothing in-built to manage dialog boxes as it is entirely agnostic to the context in which it is used. However, you can customise extra behaviour on retries with an onRetry delegate so you can hook a dialog box in there. Overall:
Use an outer RetryForever policy, and display the dialog box in the onRetry action configured on that policy.
If you want a way for the user to exit the RetryForever, a cancel action in the dialog could throw some other exception (which you trap with a try-catch round all the policies), to cause an exit.
Within the outer policy, use an inner Retry policy for however many tries you want to make without intervention.
Because this is a different policy instance from the retryforever, and has fixed retry count, the retry count will automatically start afresh each time it is executed.
Use PolicyWrap to wrap the two retry policies together.
In pseudo-code:
var retryUntilSucceedsOrUserCancels = Policy
.Handle<WhateverException>()
.RetryForever(onRetry: { /* show my dialog box*/ });
var retryNTimesWithoutUserIntervention = Policy
.Handle<WhateverException>()
.Retry(n); // or whatever more sophisticated retry style you want
var combined = retryUntilSucceedsOrUserCancels
.Wrap(retryNTimesWithoutUserIntervention);
combined.Execute( /* my work */ );
Of course the use of the outer RetryForever() policy is just an option: you could also build the equivalent manually.