Registering user

Hi everyone

I am performing a BPM to obtain the Employee Id into MES, but I cannot find a way to obtain it.
I am using this.call Context Client.CurrentUser but this brings me information about the user who connects and not the Employee ID since that computer is used by several users and I need to know the person who captures

using (var txScope = IceContext.CreateDefaultTransactionScope())
{
    var userId = this.callContextClient.CurrentUserId;
                    
    throw new Ice.Common.BusinessObjectException("An employee associated with the current user was not found. " + userId);

    // If there is no active activity, allow the new entry to be recorded
    txScope.Complete();

    return true; // Successful completion of the BPM
}

Someone help me with this requirement.

Give us a little more context. What exactly are you trying to do?

Why is that transaction scope there?

If you just want the employee id, you can use:

var empID = Session.EmployeeID; //Can be null

The scope of the BPM is that the worker only registers for a job or Indirect activity, I am doing this by verifying the ActiveTrans field of the LaborDtl table

1 Like