コード例 #1
0
        public virtual void logMembershipOperation(string operation, string userId, string groupId, string tenantId)
        {
            if (!string.ReferenceEquals(operation, null) && UserOperationLogEnabled)
            {
                string entityType = string.ReferenceEquals(tenantId, null) ? EntityTypes.GROUP_MEMBERSHIP : EntityTypes.TENANT_MEMBERSHIP;

                UserOperationLogContext             context      = new UserOperationLogContext();
                UserOperationLogContextEntryBuilder entryBuilder = UserOperationLogContextEntryBuilder.entry(operation, entityType).category(org.camunda.bpm.engine.history.UserOperationLogEntry_Fields.CATEGORY_ADMIN);
                IList <PropertyChange> propertyChanges           = new List <PropertyChange>();
                if (!string.ReferenceEquals(userId, null))
                {
                    propertyChanges.Add(new PropertyChange("userId", null, userId));
                }
                if (!string.ReferenceEquals(groupId, null))
                {
                    propertyChanges.Add(new PropertyChange("groupId", null, groupId));
                }
                if (!string.ReferenceEquals(tenantId, null))
                {
                    propertyChanges.Add(new PropertyChange("tenantId", null, tenantId));
                }
                entryBuilder.propertyChanges(propertyChanges);

                context.addEntry(entryBuilder.create());
                fireUserOperationLog(context);
            }
        }