public string GetStatus(AbstractUserContext userContext, string externalEntityInvocationId)
        {
            ORM <ExternalInvocationEntity> externalInvocationEntityOrm = new ORM <ExternalInvocationEntity>();
            ExternalInvocationEntity       externalInvocationEntity    = externalInvocationEntityOrm.Fetch(externalEntityInvocationId);

            Log.Warn("Get Status Operation Successfully Invoked");

            return(externalInvocationEntity.Status);
        }
        public void Start(StepStartData data)
        {
            // Get the Flow Tracking ID and Step Tracking ID
            string flowTrackingId = data.FlowTrackingID;
            string stepTrackingId = data.StepTrackingID;

            ORM <ExternalInvocationEntity> externalInvocationEntityOrm = new ORM <ExternalInvocationEntity>();
            ExternalInvocationEntity       externalInvocationEntity    = new ExternalInvocationEntity
            {
                Status         = "Running",
                FlowTrackingId = flowTrackingId,
                StepTrackingId = stepTrackingId
            };

            externalInvocationEntityOrm.Store(externalInvocationEntity);

            Log.Warn($"External Invocation Entity ID: {externalInvocationEntity.GetPrimaryKeyValue()}");
        }
        public void Complete(AbstractUserContext userContext, string externalEntityInvocationId)
        {
            ORM <ExternalInvocationEntity> externalInvocationEntityOrm = new ORM <ExternalInvocationEntity>();
            ExternalInvocationEntity       externalInvocationEntity    = externalInvocationEntityOrm.Fetch(externalEntityInvocationId);

            // Get the flow engine for the flow we'd like to complete
            FlowEngine engine = FlowEngine.GetEngine(externalInvocationEntity.FlowTrackingId);

            // Call Done to tell the Engine the Step is complete
            engine.Done(externalInvocationEntity.FlowTrackingId, externalInvocationEntity.StepTrackingId, new ResultData("Done"));

            // Mark the Entity Invocation Completed
            externalInvocationEntity.Status = "Completed";

            // Store the entity
            externalInvocationEntityOrm.Store(externalInvocationEntity);

            Log.Warn("Complete Operation Successfully Invoked");
        }