none
How to fix this Designer Workflow error?

    Question

  • Hi All,

    I am facing below error while trying to publish designer 2010 worflow:

    (0, 0) Activity 'ID18' validation failed: An IfElseActivity must have at least one child of type IfElseBranchActivity.)

    How to fix this issue?

    Thanks in advance!

    mercredi 10 septembre 2014 09:53

Réponses

  • A long time after the original post, but there is actually a different answer to this that no-one has mentioned.

    It IS actually possible to have multiple Else If branches, BUT not empty ones.

    What the error message say is true.

    You probably have a extra Else If branch in your workflow, but it might not show up very easily in the designer.

    If you hover over each of your If statements, and the bottom of one of them there if probably an ElseIf block with NO condition and NO actions inside it. Delete this and you are suddenly all OK. It will show as a small block that you can see if you select or hover over it.

    How did I discover this? Weeelll

    If you have a short workflow it is easy-ish to find.

    If not, then you can actually get to the file with the Activity ID 18 in, and do a search through that file.

    In SPDesigner go to All Files, Workflows and you will find a workflowname.xoml file

    Open this in NOTEPAD and do a find for your activity ID mentioned in the error message above. It will be there as an empty ElseIf block. Now, it is tempting to delete it directly from here, but the safer way is to note where in your workflow it is - what are the things immediately before and after it. Then go back to your workflow in SPDesigner text based editing environment and select and delete the empty block from there.

    Save, and publish. Hurray!


    Ruth, UK

    • Proposé comme réponse eLGi vendredi 23 juin 2017 07:39
    • Marqué comme réponse SamDany jeudi 19 juillet 2018 06:43
    vendredi 19 juin 2015 16:49
  • mercredi 10 septembre 2014 13:05

Toutes les réponses

  • Have you migrated from earlier version if then need again click on each node to publish again in 2013.

    Regards

    Prahanth

    mercredi 10 septembre 2014 10:25
  • mercredi 10 septembre 2014 13:05
  • Hi Sam,

    This error is due to the if - else branches. Hope you might be using in your workflow.

    Designer workflow doesn't accept multiple Else If conditions. Modify the workflow to have 'If - Else If' and then try to publish. In other words 'If' condition should have only one 'Else If' condition.

    Note: 

    after modifying the workflow, save and close the designer. Clear the cache at the following folders and then open designer and publish the workflow.

    C:\Users\loggedin-id\AppData\Roaming\Microsoft\SharePoint Designer\ProxyAssemblyCache  OR    %AppData%\AppData\Roaming\Microsoft\SharePoint Designer\ProxyAssemblyCache<o:p></o:p>

    C:\Users\loggedin-id\AppData\Local\Microsoft\WebsiteCache   OR     %AppData%\ AppData\Local\Microsoft\WebsiteCache

    C:\Users\loggedin-id\ Roaming\Microsoft\Web Server Extensions\Cache   OR    %AppData%\Roaming\Microsoft\Web Server Extensions\Cache

    Thanks

    Senthu

    -------------------------------------------------------------------------------------

    please mark as 'Answer' if it resolves your query or 'Vote' if this post is helpful

    vendredi 19 septembre 2014 10:14
  • A long time after the original post, but there is actually a different answer to this that no-one has mentioned.

    It IS actually possible to have multiple Else If branches, BUT not empty ones.

    What the error message say is true.

    You probably have a extra Else If branch in your workflow, but it might not show up very easily in the designer.

    If you hover over each of your If statements, and the bottom of one of them there if probably an ElseIf block with NO condition and NO actions inside it. Delete this and you are suddenly all OK. It will show as a small block that you can see if you select or hover over it.

    How did I discover this? Weeelll

    If you have a short workflow it is easy-ish to find.

    If not, then you can actually get to the file with the Activity ID 18 in, and do a search through that file.

    In SPDesigner go to All Files, Workflows and you will find a workflowname.xoml file

    Open this in NOTEPAD and do a find for your activity ID mentioned in the error message above. It will be there as an empty ElseIf block. Now, it is tempting to delete it directly from here, but the safer way is to note where in your workflow it is - what are the things immediately before and after it. Then go back to your workflow in SPDesigner text based editing environment and select and delete the empty block from there.

    Save, and publish. Hurray!


    Ruth, UK

    • Proposé comme réponse eLGi vendredi 23 juin 2017 07:39
    • Marqué comme réponse SamDany jeudi 19 juillet 2018 06:43
    vendredi 19 juin 2015 16:49
  • Ruth, thank you. I struggled. I even pared down the workflow to eliminate any If statements but it was still failing. After opening that file, there was the gremlin hiding at the bottom. It came along for the ride during a copy and paste. I wish I had found your post 3 hours ago. Embarrassed, but yes that's how long I was trying different logging techniques to solve this.

    samedi 21 novembre 2015 21:57
  • Thank you very much! 

    I've modified xoml file and it did contained empty IfElseBranchActivity. When I removed it, reupload to server, reopen Designer now it works like a charm, and I can have more than one else! :D

    vendredi 23 juin 2017 07:40
  • Ruth, thank you for saving me HOURS of rework. Kudos!!!


    Keith Hudson

    vendredi 13 juillet 2018 19:53