message: Fixes - moved the device profile specific formatting logic before creating an application
  Merging PR using squash and merge
diff: @@ -27,8 +27,7 @@ export function importApp(fromApp) {
  throw ErrorManager.createValidationError('Validation error', { details: errors });
  }
  })
  - .then(() => AppsManager.create(clonedApp))
  - .then(app => {
  + .then(() => {
  if (appProfile === FLOGO_PROFILE_TYPES.DEVICE) {
  return Promise.all([
  ContribDeviceManager.find({type: 'flogo:device:trigger'}),
  @@ -39,8 +38,8 @@ export function importApp(fromApp) {
  fromApp.actions = fromApp.actions.map(action => deviceActionFormatter(action, activityContribs));
  });
  }
  - return app;
  })
  + .then(() => AppsManager.create(clonedApp))
  .then(app => Promise.all(fromApp.actions.map(action =>
  ActionsManager.create(app.id, action).then(storedAction => [action.id, storedAction])))
  .then(actionPairs => ({ appId: app.id, actionsMap: new Map(actionPairs) })),
  