Skip to content

Commit

Permalink
allow camel browse to forward messages to a new endpoint that doens't…
Browse files Browse the repository at this point in the history
… exist yet
  • Loading branch information
jstrachan committed May 1, 2013
1 parent 3ed2497 commit 2c019a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hawtio-web/src/main/webapp/app/camel/js/browse.ts
Expand Up @@ -42,7 +42,10 @@ module Camel {
var mbean = getSelectionCamelContextMBean(workspace);
var selectedItems = $scope.gridOptions.selectedItems;
var uri = $scope.endpointUri;
if (mbean && selectedItems && uri) {
if (mbean && uri && selectedItems && selectedItems.length) {
//console.log("Creating a new endpoint called: " + uri + " just in case!");
jolokia.execute(mbean, "createEndpoint(java.lang.String)", uri, onSuccess(intermediateResult));

$scope.message = "Forwarded " + Core.maybePlural(selectedItems.length, "message" + " to " + uri);
angular.forEach(selectedItems, (item, idx) => {
var callback = (idx + 1 < selectedItems.length) ? intermediateResult : operationSuccess;
Expand Down

0 comments on commit 2c019a4

Please sign in to comment.