コード例 #1
0
        private void DoDelete(ICRMEvent context, Guid pluginStepId, mwo_PluginStepRegistration subject)
        {
            subject.mwo_ImageType = mwo_ImageType.None;
            DoManageImage(context, pluginStepId, subject);

            StepManager.Delete(pluginStepId);
            Tracer.Trace($"Deleted PluginStep: {pluginStepId}");
        }
コード例 #2
0
 private void DoManageStage(ICRMEvent context, Guid pluginStepId, mwo_PluginStepRegistration subject)
 {
     if (subject.StateCode == mwo_PluginStepRegistrationState.Active)
     {
         StepManager.Activate(pluginStepId);
         Tracer.Trace($"Activated PluginStep: {pluginStepId}");
     }
     else
     {
         StepManager.Deactivate(pluginStepId);
         Tracer.Trace($"Deactivated PluginStep: {pluginStepId}");
     }
 }
コード例 #3
0
 private void DoManageImage(ICRMEvent context, Guid pluginStepId, mwo_PluginStepRegistration subject)
 {
     if (subject.mwo_ImageType != null && subject.mwo_ImageType != mwo_ImageType.None)
     {
         ImageManager.Upsert(MapImageType(subject.mwo_ImageType), subject.mwo_ImageName, new EntityReference(SdkMessageProcessingStep.EntityLogicalName, pluginStepId), subject.mwo_ImageAttributes);
         Tracer.Trace($"Upserted image: {subject.mwo_ImageName}");
     }
     else
     {
         ImageManager.Delete(new EntityReference(SdkMessageProcessingStep.EntityLogicalName, pluginStepId));
         Tracer.Trace($"Deleted image: {subject.mwo_ImageName}");
     }
 }
コード例 #4
0
        private void DoUpdate(ICRMEvent context, Guid pluginStepId, mwo_PluginStepRegistration subject)
        {
            StepManager.Update(
                pluginStepId,
                subject.mwo_EventHandler,
                MapPluginType(subject.mwo_EventHandlerType),
                subject.mwo_Name,
                subject.mwo_SDKMessage,
                subject.mwo_PrimaryEntity,
                subject.mwo_SecondaryEntity,
                subject.mwo_StepConfiguration,
                subject.mwo_Asynchronous == true,
                MapStage(subject.mwo_PluginStepStage),
                subject.mwo_FilteringAttributes,
                subject.mwo_Description);

            Tracer.Trace($"Updated PluginStep: {pluginStepId}");

            DoManageImage(context, pluginStepId, subject);
        }
コード例 #5
0
        private void DoCreate(ICRMEvent context, mwo_PluginStepRegistration subject)
        {
            var res = StepManager.Register(
                subject.mwo_EventHandler,
                MapPluginType(subject.mwo_EventHandlerType),
                subject.mwo_Name,
                subject.mwo_SDKMessage,
                subject.mwo_PrimaryEntity,
                subject.mwo_SecondaryEntity,
                subject.mwo_StepConfiguration,
                subject.mwo_Asynchronous == true,
                MapStage(subject.mwo_PluginStepStage),
                subject.mwo_FilteringAttributes,
                subject.mwo_Description);

            Tracer.Trace($"Created new PluginStep: {res}");
            subject.mwo_PluginStepId = res.ToString();

            DoManageImage(context, res, subject);
        }