class UserCreationWorkflow extends BaseUserEditorWorkflow {

    @Override
    protected void afterSave(String id) {
        // Ask for password input at user creation time.
        confirmBox.show(UsersManagementWidgetsConstants.INSTANCE.confirmAction(),
                        UsersManagementWidgetsConstants.INSTANCE.doSetPasswordNow(),
                        new Command() {
                            @Override
                            public void execute() {
                                // Set a password for the new user.
                                showPasswordPopup(new ChangePassword.ChangePasswordCallback() {
                                    @Override
                                    public void onPasswordUpdated() {
                                        doAfterSave(user.getIdentifier());
                                    }

                                    @Override
                                    public void onError(Throwable throwable) {
                                        showError(throwable);
                                        onCancel();
                                    }
                                });
                            }
                        },
                        new Command() {
                            @Override
                            public void execute() {
                                // Do not set a password for the new user.
                                doAfterSave(user.getIdentifier());
                            }
                        });
    }

    @Inject public  UserCreationWorkflow(final ClientUserSystemManager userSystemManager,
                                final Event<OnErrorEvent> errorEvent,
                                final Event<NotificationEvent> workbenchNotification,
                                final Event<DeleteUserEvent> deleteUserEvent,
                                final Event<SaveUserEvent> saveUserEvent,
                                final Event<CreateUserEvent> createUserEvent,
                                final ConfirmBox confirmBox,
                                final CreateEntity createEntity,
                                final UserEditor userEditor,
                                final UserEditorDriver userEditorDriver,
                                final ChangePassword changePassword,
                                final LoadingBox loadingBox,
                                final EntityWorkflowView view);

}