Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
If you're creating a bug/problem report, please include followings:
I have some entities like below:
public class Order :AggregateRoot<Guid>
{
public string Name { get; set; }
public string Address { get; set; }
public ICollection<OrderLine> Lines { get; set; }
}
public class OrderLine:Entity<Guid>
{
public Guid ProductId { get; set; }
public Guid OrderId { get; set; }
public int Quantity { get; set; }
public Product Product { get;}
}
public class Product:AggregateRoot<Guid>
{
public string Name { get; set; }
public string Description { get; set; }
}
public class EfCoreOrderRepository : EfCoreRepository<CommonDbContext, Order, Guid>, IOrderRepository
{
public async Task<Order> GetWithNavigationPropertiesAsync(Guid id)
{
var query = from order in (await GetDbSetAsync()).Include(p => p.Lines).ThenInclude(s => s.Product)
where order.Id == id
select order;
return await query.SingleAsync();
}
}
I've added Product as a navigation property to OrderLine entity. But as we see in docs there is a section which says:
Do always reference to other aggregate roots by Id. Never add navigation properties to other aggregate roots.
GetWithNavigationPropertiesAsync method.This user can grant admin role to any user, or revoke admin role from any user as you can see in Picture 2. I want to create a role which can create/edit/lock/unlock user, assign/deassign roles to/from user. But i do not want the owner of this role to assign/deassign admin (or marked as special or private other roles) some other roles from/to users. There may be a solution like a new property for role as private. Define a new permission under Identity Management permission section for grant/revoke private role. Should be a new permission for grant/rekove private roles to any user. And owner of role-supervisor should not act on some private/special users.
Hi @liangshiwei
In above message your suggestion (below code) does not solve our problem. If we got any error on backgroudjob creation, process will be broken. If it's a UI call, user will get an error and business will be completed. As @ademaygun said there is no UI dashboard to manage and see background jobs for ABP's BackgroundJob system and in the documents ABP suggest us hangfire as an integrated solution. But ABP does not work with Hangfire properly. There would be same problem in EventBus but luckly ABP solves that problem with implementing inbox pattern. There could be same solution for background jobs.
Is it possible to discuss this problem with the team? This problem is really critical for us.
public async Task CreateAsync()
{
using (var uow = _unitOfWorkManager.Begin(requiresNew: true, isTransactional: true))
{
//...
await productRepository.InsertAsync(new Product("Product1"));
await uow.CompleteAsync();
}
await backgroundJobManager.EnqueueAsync(ProductJobArgs);
}
We create appService methods with [UnitOfWork(true)] attribute.
Call our business related codes/methods and then make await CurrentUnitOfWork.SaveChangesAsync();
Then call one or more background job creation calls and when exit from appService methods ABP calls CompleteAsnyc method. In this stiuation if any error occurs (like below), background jobs are created and our operations are (on business related tables) rollbacked.
How can we make background job work in the same transaction with our business code; so it will not created or rolledback when we get any error on method completion (CompleAsync)
[ERR] The operation was canceled.
System.OperationCanceledException: The operation was canceled.
at System.Threading.CancellationToken.ThrowOperationCanceledException()
at Npgsql.Internal.NpgsqlConnector.<StartUserAction>g__DoStartUserAction|257_0(<>c__DisplayClass257_0& )
at Npgsql.Internal.NpgsqlConnector.StartUserAction(ConnectorState newState, NpgsqlCommand command, CancellationToken cancellationToken, Boolean attemptPgCancellation)
at Npgsql.NpgsqlTransaction.Commit(Boolean async, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.CommitAsync(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.CommitAsync(CancellationToken cancellationToken)
at Volo.Abp.Uow.EntityFrameworkCore.EfCoreTransactionApi.CommitAsync()
at Volo.Abp.Uow.UnitOfWork.CommitTransactionsAsync()
at Volo.Abp.Uow.UnitOfWork.CompleteAsync(CancellationToken cancellationToken)
at Volo.Abp.AspNetCore.Mvc.Uow.AbpUowActionFilter.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
[UnitOfWork(true)]
public async Task CreateAsync()
{
await productRepository.InsertAsync(new Product("Product1"));
await CurrentUnitOfWork.SaveChangesAsync();
await backgroundJobManager.EnqueueAsync(ProductJobArgs);
}
Hi liangshiwei,
Send an email
We use Distributed Event Bus via RabbitMQ to share data between two services which is also ABP project (v.4.4.4). v5.2.1 is publisher and v4.4.4 is subscriber.
We start v4.4.4 Project to create exchange and queues and to be sure we stop the project.
Then we create messages from 5.2.1 project and then queues and exchange created on rabbitmq.
We do this on test and dev environment.
Sometimes we create a message on test go to project2test as we expect, sometimes go to project2dev and sometimes message does not appear anywhere.
We tried true and false for useOutbox parameter and enabled outbox but nothing changed. We do not see any records on AbpEventOutbox on v5.2.1 publisher project.
RabbitMQ Generated Queues for environments and projects | Exchange | Queue | Environment | | --- | --- | --- | | project1testexch | project1test | test | | project1testexch | project2test | test | | project1devexch | project1dev | development | | project1devexch | project2dev | development |
AppSettings | project | environment | clientname | exchangename | | --- | --- | --- | --- | | project1 | test | project1test | project1testexch | | project2 | test | project2test | project1testexch | | project1 | dev | project1dev | project1devexch | | project2 | dev | project2dev | project1devexch |
If you created isseu on github, can you please share issue link, to track status. Thank you
As you can see in the first message, there is no validation message on Password Reset screen (ui page). It only disables button, does not give any validation message.
Will you also include same validation messages on password reset screen?
If the error messages are not user friendly, you can customize them. The problem is not related with user friendly or not. As you can see in screen shot, one of the validation message is Turkish, and the other one is English. This is not a normal situation.
Also can you check these page is angular or mvc? We use resource owner flow password flow, so these pages are Angular.