cancel
Showing results for 
Search instead for 
Did you mean: 

Sequence of data in tags

MayankGoyal2
Level 8
Hi,
We have a requirement to track progress of WQ item like - Step 1 Completed, Step 2 completed.....
Please suggest if there is a way to maintain tags on WQ item in sequence its inserted and not to arrange it alphabetically.

Also if this cannot be done in tags, is there an alternate column in WQ to maintain summary of progress in sequence its updated?

------------------------------
Mayank Goyal
------------------------------
8 REPLIES 8

NicholasZejdlik
Level 9
Tags don't have any order associated with them. You could still tag items with "Step 1 Completed", "Step 2 Completed", though I'd suggest using the Status instead. It'll get overwritten every time you change it, but it seems fitting for an indicator of which step it's on. If you need a record of sorts of what steps have been executed against an item (perhaps some items run step 1 and step 2, and others run step 1 and step 3 for example), then tags would probably still be your best bet. Is there a reason you're looking to have them ordered in some fashion?

------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------

Just tested by creating a new test queue with tags I haven't used before (in this case, "Tag1", "Tag2"). I created one work queue item with tags in that order, then a subsequent item with tags in the opposite order. If I look in the control room, it always shows up in the first order, which is the order the tags were initially created.

You can use the following query to see how each tag maps to each queue item. (Just make sure to change the schema name!) If you query only the BPATag table, you'll see that tags are added into the database and then subsequently cached for reuse. Tags are then referenced by index within rows of the BPAWorkQueueITemTag table. Thus, the control room must be doing a sort on BPATag.id (or BPAWorkQueueItemTag.tagid) asc.
SELECT TOP (1000) [queueitemident]
      ,[tagid], b.tag
  FROM [BP_Test].[dbo].[BPAWorkQueueItemTag]
  left join [BP_Test].[dbo].[BPATag] as b on tagid=b.id​



------------------------------
Ami Barrett
Automation Developer, Team Lead
Blue Prism
Plano, TX
------------------------------

@Nicholas Zejdlik - I have to maintain a high level summary of steps and report it in queue report like Step1 - Details; Step2 - Details; Exception: Reason of Exception; System/Business Exception or if completed then Step1 - Details; Step2 - Details; completed

So sequence will help to report it in correct order.

Also please suggest if WQ item goes to retry and I have to clear all tags from it, is there a direct action or I need to split it with semicolon, then loop and remove?

Also if there a better way to store this progress other than Tags please suggest the same

------------------------------
Mayank Goyal
------------------------------

As Nick said, you could store this information in the status field, rather than a tag field. If you need it delimited, you can concatenate it in on your own.

From an optimisation standpoint, using the tags field for storing exceptions is generally a bad idea as it allows for too much variance. Any potential fail point could result in a new tag being created (and tags are permanently stored in the database, even if the work queue item it was generated from is removed). The more tags you have, the longer it may take for a lookup query. It's best to keep them as generic as you are able to within your process, in such a way that yields high reusability of the same string. (Likewise, from a data security standpoint, this is slightly more secure as both the status and tag fields are typically unencrypted. (Fewer rows, easier to clean.))

While you can leverage all available fields tied to work queue items to generate dynamic reports, it's not recommended based on personal experience. You can get away with doing summary tables during off hours, but querying the BP schema directly with queries complex enough to generate useful report data can throttle your environment. If you're trying to generate reports (which I'm only assuming is the case at this point, I may be wrong), you're better off writing to an external database somewhere.

As for retries and tags, per the attached image, it appears custom tags are typically maintained. The exception tag seen below was generated by me right-clicking the work queue item and marking it as an exception. It was then removed when I forced a retry.
15140.png


------------------------------
Ami Barrett
Automation Developer, Team Lead
Blue Prism
Plano, TX
------------------------------

@AmiBarrett - Thanks a lot for your response.
Regarding Exception - I believe BP has a internal functionality of tagging WQ item with exception reason when we mark item as exception. I am not sure if that impacts the performance and if there is a way to skip it.

Regarding 2nd part, yes when we retry all tags and status is copied to new item except the one created as "Exception:reason of exception".
I was looking if there a action in WQ VBO that can clean all tags from WQ item.​

------------------------------
Mayank Goyal
------------------------------

@AmiBarrett - Any inputs on above?



------------------------------
Mayank Goyal
------------------------------

There is very intentionally not a way to skip the exception adding process, as we're specifically clicking "Mark as Exception."

There is no VBO for cleaning tags tied to queue items. The closest you'll likely get, is the SQL VBO where you can bash your own queries.



------------------------------
Ami Barrett
Automation Developer, Team Lead
Blue Prism
Plano, TX
------------------------------

While there's not an action in the Work Queue object to remove all tags, since tags can be modified without locking an item, you can create your own action to handle it. Here's an example of one such action. Split Text points to the action in Utility - Strings and splits on a semi-colon. Get Item Data and Untag Item are both Work Queue actions.

15146.png

One thing I would point out is if you needed to tag the work queue items with something aside from the "StepX" stuff, then this would potentially cause a problem with that. I'd personally recommend adding some kind of filter that lets you clear specific tags, for example maybe only clear the tag if it starts with "Step".

As far as the sequence issue goes, I don't think there's a good way to store that kind of information in the work queue. You could have an additional collection in the item data that contains the steps completed, but depending on how you are reporting on it, that could be problematic to pull it later. If you want to stick with the work queue tags, I'd add some sort of logic in your reporting piece so it can understand how to order the tags properly.

What I personally do as far as reporting goes, I tag items with a "Type" tag (like Type: Imported, or Type: Failed to Get Data). On each process, whenever a work queue item is completed or exceptioned, it tags it with a type based on which branch of the process it went down (it has to remove the old Type tag first). That way on more complicated processes where a simple success/failure doesn't exactly indicate what the result was, it can tag the item with a type. Using that type, I can know what branch the process went down. Rather than reporting on the specific actions taking place in the process, it reports on the endpoint, which gives me enough information to know what logic the process branched into to get to that point. The advantage of this is I can reconstruct the steps that were executed during the process by merit of which endpoint it reached, and it's much simpler to implement since I only need to think about it whenever I have a Mark Completed / Mark Exception stage (I created a wrapper around the Work Queues object to further reduce the number of actions that processes have to call).



------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------