protected override bool InternalExecute(ProcessExecutingContext context) { ProcessSchemaManager processSchemaManager = UserConnection.ProcessSchemaManager; Guid uid = ProcessSchemaUId; if (processSchemaManager.FindItemByUId(ProcessSchemaUId) == null) { uid = ((Select) new Select(UserConnection).Top(1) .Column("UId") .From("SysSchema") .Where("Id").IsEqual(Column.Parameter(ProcessSchemaUId))) .ExecuteScalar <Guid>(); } ProcessSchema processSchema = GetProcessSchema(uid); if (!processSchema.Enabled) { return(true); } Dictionary <string, string> nameValueMap = new Dictionary <string, string>(); if (!string.IsNullOrWhiteSpace(CustomPropertyValues)) { nameValueMap = Common.Json.Json.Deserialize <Dictionary <string, string> >(CustomPropertyValues); } nameValueMap["OpportunityId"] = OpportunityId.ToString(); if (CanUseFlowEngine(processSchema)) { RunFlowEngineProcess(processSchema, nameValueMap); } else { Process process = processSchema.CreateProcess(UserConnection); foreach (KeyValuePair <string, string> keyValuePair in nameValueMap) { var parameter = processSchema.Parameters.FindByName(keyValuePair.Key); if (parameter != null) { var valueType = parameter.DataValueType.ValueType; System.ComponentModel.TypeConverter typeConverter = System.ComponentModel.TypeDescriptor.GetConverter(valueType); object value = typeConverter.ConvertFromString(keyValuePair.Value); process.SetPropertyValue(keyValuePair.Key, value); } } process.Execute(UserConnection); } return(true); }