The following assumes ISIS is the motivator.
It is interesting that the attacks in St. Jean and Ottawa focussed exclusively on military and political targets, not specifically civilians (although two were apparently wounded yesterday). Three times (pray not a third), and it's a strategy. I don't know what ISIS propaganda says about strategy, but if they're calling themselves the Islamic State and are the ones inspiring these attacks, then perhaps this is a sign they intend to fight like a state. These attacks targeted the political leadership and the military of a state (Canada) presently at war with ISIS.
This is an interesting point to consider.
An attack on civilians like 9/11 or the train and tube bombings in Europe mobilises politicians and publics to send large numbers of soldiers to Afghanistan, or Iraq or anywhere Muslim and disfavourable because innocents are reprehensibly killed and the public is legitimately fearful. The response that sends large numbers of Western troops to works as an Islamist recruiting tactic. However, it is useful only to a point as so much military attention of a long period just inhibits the project of setting up a Caliphate or whatever the big actual goal is called. People don't exactly thrive under military occupation and attacking civilians in the West tends to encourage lots of military occupation.
However, attacking the political and military targets in the West doesn't provide a lot of public outrage that would fuel more war because it wasn't the public that was hit. I imagine that right now ISIS is looking at the growing number of forces arrayed against it and starting to wonder about its short or long-term survival. Perhaps it thinks that it is much harder for leaders to justify to Western publics military intervention in Iraq and Syria if ISIS can be seen to attack 'legitimate' wartime targets. Unlike terrorising the public, it is very difficult to logically justify risking more soldiers lives as some kind of vengeance for killing soldiers. Maybe ISIS has two goals.
1. If ISIS can convince the West that it isn't interested in killing large numbers of Western civilians, maybe it thinks the US and other countries will fail to sustain interest in hammering ISIS.
2. It has also demonstrated that it can hit back in the Western countries that are now attacking it. In Ottawa, it got perilously close to the leadership in one of them.
In a few days, ISIS has also forced the entire Canadian military to adopt a defensive posture in Canada. It has forced them to conceal themselves in public against an enemy they can't see, right around the corner from Remembrance Day when they'd all be on display. When that happens on a battlefield, it's described as denying freedom of movement and is a major tactical gain if it can be done.
That makes these attacks a helluva move. It's also how states fight wars with each other.