1. I create a action named "new_testAction" which is called by a workflow, and it has input parameter and output parameter.
2. I register a plugin step on this action message .
3. plugin code is here below.
public class Try_WorkFlowPlugin_P : IPlugin { /// <summary> /// @function void Execute(IServiceProvider serviceProvider) /// @description /// @param {IServiceProvider} serviceProvider /// @return {void} None /// </summary> public void Execute(IServiceProvider serviceProvider) { //Obtain the execution context from the service provider. var context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); if (factory == null) { throw new InvalidPluginExecutionException("Failed to retrieve the organization service."); } ITracingService tracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService)); if (tracingService == null) { throw new InvalidPluginExecutionException("Failed to retrieve the tracing service."); } try { //Check if context message is not Update then return and does not execute code if (context.InputParameters.Contains("testAction")) { #if DEBUG tracingService.Trace("testAction parameter is in"); #endif } else { #if DEBUG tracingService.Trace("testAction parameter is not here"); #endif } if (context.InputParameters.Contains("outPut")) { #if DEBUG tracingService.Trace("outPut parameter is in"); #endif } else { #if DEBUG tracingService.Trace("outPut parameter is not here"); #endif } tracingService.Trace("output parameter is {0}", context.OutputParameters["outPut"]); context.OutputParameters["outPut"] = "SettingOutput"; ((IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext))).OutputParameters["outPut"] = "SettingOutput"; } catch (Exception e) { #if DEBUG tracingService.Trace("Exception: {0} ", e.ToString()); #endif if (e.InnerException != null) { throw new InvalidPluginExecutionException(e.InnerException.Message.ToString()); } else { throw; } } } }
4 the problem is , it create entity b which is general when parameter-output is null, i had filled output with "SettingOutput" ,why can't i get it in action.
Any ideas?
Thank you for your help.
best regards
*This post is locked for comments