Example #1
0
        public void ReturnErrorPublishAWorkflowForValidWorkflowServiceNameAndInvalidVersion()
        {
            client = new WorkflowsQueryServiceClient();

            pubReq = new PublishingRequest();
            pubReq.Incaller = ALIAS;
            pubReq.IncallerVersion = VERSION;
            pubReq.WorkflowName = WORKFLOWNAME;
            pubReq.WorkflowVersion = BAD_VERSION;

            pubReply = client.PublishWorkflow(pubReq);

            Assert.IsNotNull(pubReply, "pubReply is Null");
            Assert.AreEqual(SprocValues.GENERIC_CATCH_ID, pubReply.StatusReply.Errorcode, string.Format("Errorcode: {0}", pubReply.StatusReply.Errorcode));
            Assert.AreNotEqual(string.Empty, pubReply.StatusReply.ErrorMessage, string.Format("ErrorMessage: {0}", pubReply.StatusReply.ErrorMessage));

            Console.WriteLine();
        }
Example #2
0
        /// <summary>
        /// The publish command execute.
        /// </summary>
        /// <exception cref="NotImplementedException">
        /// </exception>
        private void PublishCommandExecute()
        {
            PublishingReply reply = new PublishingReply();
            try
            {
                Utility.DoTaskWithBusyCaption("Publishing...", () =>
                    {
                        // First, save to server if necessary, so that Publish can find it
                        FocusedWorkflowItem.Status = MarketplaceStatus.Public.ToString();
                        FocusedWorkflowItem.XamlCode = FocusedWorkflowItem.WorkflowDesigner.CompileProject.ProjectXaml;

                        // Stop publishing if saving failed.
                        if (!WorkflowsQueryServiceUtility.UsingClientReturn(client => UploadWorkflow(client, this.FocusedWorkflowItem, shouldBeLoose: false)))
                            return;

                        reply = WorkflowsQueryServiceUtility.UsingClientReturn(client => PublishCommandExecute_Implementation(client, this.FocusedWorkflowItem));
                    }, false);

                if (reply.StatusReply == null)
                {
                    return;
                }
                else if (0 != reply.StatusReply.Errorcode)
                {
                    MessageBoxService.Show(reply.StatusReply.ErrorMessage, "Publish Error", MessageBoxButton.OK,
                                           MessageBoxImage.Error);
                }
                else
                {

                    if (string.IsNullOrEmpty(reply.PublishErrors))
                    {
                        MessageBoxService.ShowClickable(
                            string.Format("Workflow: {0} Version {1} was published to:", this.FocusedWorkflowItem.Name,
                                          reply.PublishedVersion), "Publish Status", reply.PublishedLocation);
                    }
                    else
                    {
                        MessageBoxService.ShowClickable(
                            string.Format(
                                "Workflow: {0} Version {1} was published with errors reported during publish: {2}",
                                this.FocusedWorkflowItem.Name, reply.PublishedVersion, reply.PublishErrors), "Publish Status",
                            reply.PublishedLocation);
                        // Stop publishing if saving failed.
                    }
                }
            }
            catch (Exception ex)
            {
                throw new UserFacingException(ex.Message);
            }
        }