コード例 #1
0
        private OrganizationRequest CreateStep(IOrganizationService service, string entityLogicalName, string bPFLogicalName, bool isUpdate)
        {
            var lookupName = GetBPFLookup(service, bPFLogicalName, entityLogicalName);

            Dictionary <string, object> actionParams = new Dictionary <string, object>();

            actionParams.Add("UnsecureConfiguration", entityLogicalName);
            actionParams.Add("PrimaryEntity", bPFLogicalName);
            actionParams.Add("PluginAssemblyName", "CodecLabs.BPFTracking.Plugins");
            actionParams.Add("EventHandler", "CodecLabs.BPFTracking.Plugins.BPFStageChanged");
            actionParams.Add("Mode", 0);
            actionParams.Add("Rank", 100);
            actionParams.Add("InvocationSource", 0);
            actionParams.Add("Deployment", 0);
            actionParams.Add("ImageCustomizationLevel", 0);
            actionParams.Add("ImageAttributes", $"activestageid,activestagestartedon,{lookupName},processid");

            if (isUpdate)
            {
                actionParams.Add("Message", "Update");
                actionParams.Add("Stage", 20);
                actionParams.Add("ImageType", 0);
                actionParams.Add("ImageEntityAlias", "PreImage");
                actionParams.Add("ImageName", "PreImage");
                actionParams.Add("UpdateFields", "activestageid,statecode");
            }
            else
            {
                actionParams.Add("Message", "Create");
                actionParams.Add("Stage", 40);
                actionParams.Add("ImageType", 1);
                actionParams.Add("ImageEntityAlias", "PostImage");
                actionParams.Add("ImageName", "PostImage");
            }

            return(SDKHelper.BuildCallAction(service, "clabs_CodecLabsRegisterPluginStep", actionParams));
        }