3 Replies Latest reply on Jan 23, 2018 7:42 AM by xili

    Workflow instance identification

    xili Apprentice

      One of my workflows (I call it "leaf workflow") would be invoked by different other workflow instances from one request or possibly multiple requests of the same "Request Offering" at the same time, but I only want the "leaf workflow" be executed for one request.


      To archive that, I have the top workflow grab and save a "global counter value" as a base so that when the "leaf workflow" is invoked later by whoever, it checks if it has a "token" (explained below). If it has the token, then it moves on and executes; otherwise, it exits.


      The token is the value of the saved "global counter value" + 1. In the "leaf workflow", I use the logic the saved "global counter value" + 1 == GetNextCounter(CounterName) to see if the current leaf workflow instance got the token. GetNextCounter(CounterName) will return the next value of the counter, and it should not be ambiguous in multi-thread environment for one request (I have to use some other way to deal with multiple requests situation). However, I got inconsistent results, so I am lost. It's so hard to debug with the tool and there seems to be no "local" variables in a workflow for identification purposes. I am trying to use workflow instance Event ID, but I don't see a way to access it. Any suggestions would be greatly appreciated.

        • 1. Re: Workflow instance identification
          danielsarnowski SupportEmployee



          I am not sure if I get your question right. I would imagine that you want to check what is the results of specific blocks within Workflow. There are 2 lists setup on OOTB called "Workflow History" and "Workflow Instance". They contain informaiton about execution of blocks and what was the exit results. I suggest sorting them out by creation/modify date to follow them along the workflow.




          1 of 1 people found this helpful
          • 2. Re: Workflow instance identification
            xili Apprentice

            Thanks Daniel; those pieces of info are what I was looking for, but I cannot retrieve the info from inside workflow so that some execution paths can be changed on the fly.

            • 3. Re: Workflow instance identification
              xili Apprentice

              I believe workflow instance is not a program process in some aspects and it is more like a function execution, so I guess that's why there are event IDs of workflow executions but no instance IDs. The reason I tried to figure out workflow instance identification was my original design method issue. I've since changed my design to avoid this kind of needs.