The prophet (SWS) ordered the army of Usama to move to the boarders for war. This took place when the prophet was already suffering from the illness that resulted in his passing away. The historical records are evident that:
1. Even when the prophet was in his difficult moments of illness he did not asked the army to stop.
2. All the major pioneers of Muhajers and Ansar were in the army, including Abubakr and Umar.
My question is:
Assuming that the prophet knew that he was passing away (as apparent from many historical documents), why he wanted to send the closest companions (and in fact the potential candidates for Khelafat) far away? I was thinking that in such circumstances a wise decision would be to keep the potential candidates for khelafat close and in access. This is particularly important if we agree that Shora is the basis of the affairs after the holy prophet.
Imagine if the army had prepared a couple of days earlier and they had all gone to war. Then the prophet would pass away while almost none of his close companions where there. The main companions of the prophet were absent only for a short time and the leadership was going to be given to people (Ansar) who might not have been accepted later by the rest (Quraysh). What would have happened if the companions where far away near the boarders and then the remaining people wanted to choose a Khlifa among themselves.
Please explain the idea behind sending the army in that critical time.
On a side note, please also let me know the status of two companions, Abubakr and Ali with regrad to the army. It appears like Abubakr left the camp of the army soon and went to his place out of Madinah. Was this because he was excluded from the army by the prophet when he was ordered to lead the prayers? As for Ali, his name is mentioned no where with regard to Usama army. It appears as if he never joined the army, was he also excluded?
Before coming to your specific question I would like to state that it would not be academically right to object to anything merely on the basis of assumptions. If we follow the course we can easily get to the answer as well. If we assume that the Prophet (sws) knew that he was going to die we can also add the fact to our assumption that he was told by the Almighty that the army would not depart before his death. We can conjecture that by stressing upon sending the army the Holy Prophet (sws) meant to test the integrity of the companions and their willingness to submit to whoever would be appointed their leader.
Now I refer to some of the facts regarding the incident as reported in the major works on early Islamic history that will help us understand the matter better.
The Prophet (sws) organized an army of about seven hundred men to advance to the Syrian borders.
Some of the great companions of the Holy Prophet (sws) were asked to join. However, it was not an open call for war requiring every one to participate.
Most of the sources mention that Umar (rta) was also required to participate in the campaign.
Many of the great companions were not included in the army Abu Bakr was among the exempted. Only a single report mentions his name but with sheer uncertainty. Some other reports mention many famous and great Muslim leaders to be in Madina even after the army had left. These leaders were dispatched to put down the revolts by those tribes who had hastened to attack the Muslims.
Another important matter in this regard is Tabari's report about Abu Bakar's successful expedition against those who hastened to attack Madina.
The Army was not organized after the Holy Prophet (sws) had become seriously ill, rather the Holy Prophet (sws) decided to dispatch it when he was in good health. This is proved by the order of the accounts relating to the last few days of the Prophet's life. In all the major works his illness always follows his organizing the army.
The above-mentioned facts coupled with the narratives which mention that many Muslim leaders attended to the Holy Prophet (sws) during the days of his illness, lead us to the conclusion that the army sent was a small number. It did not include each and every one from the Muslim camp including the potential candidates for Khilafah. When the reports regarding the illness of the Holy Prophet (sws) reached the camp the army did not hasten forward. The Holy Prophet (sws) knew this and even Usama (rta) himself returned to Madina. The report about the last speeches and exhortations of the Holy Prophet (sws) do not mention that in his critical moments he insisted on departure of the army at the very moment. We find him leading the prayer and after that frequently guiding and warning the Muslims on various issues until the last day of this life. In these circumstances emergence of any crisis can hardly be expected.
As regards the matter of Ali (rta), it seems that he too was not included in the Army, like many of the other men.
Then [Abu Hurairah] replied, "The Prophet (sws) sent an army of seven hundred men to Syria under the command of Usama Bin Zaid. When the army gathered at Zi-Khushub he passed away." [albidyah, Ibn-e-Kathir, vol., 6 page, 305]
 They set out and camped at Juruf. Umar Bin khattab is reported to have been among them. It is said that Abu Bakar was also among them but the Holy Prophet (sws) exempted him for leading prayer. [Bidayah, vol., 6. page, 304]
 Abu Bakr [rta] appointed many guards around the city who would watch during nights in small military groups. Among the leaders of these groups were Ali Bin Abi Talib, Zubair Bin al-Awwam, Talhah Bin Abdullah, Sa`ad Bin Abi Waqqaas, Abdul Rahman Bin Auf and Abdullah Bin Masood. [Albidayah wannahayah, Ibn-eKathir, 6:310]
 Abu Bakr dispatched the army of Usama in the last days of Rabi al-Awwal and the war in which Aswad Ansi was put to death was also fought in the same days after Usama's army had left. It was the first victory Abu Bakar [rta] won when he was in Madina. [Tarikh-e-Tabari 2:253], And the first whom [the caliph] encountered were the tribes of Abas and Zubyan. They hastened towards him and he confronted them before Usama had returned. [Tarikh-e-Tabari 2:254]