Skip to main content

some more clarification needed:


I have an activity "Activity1" in a process that has a start rule so that the activity will only start on STARTDATE


In this process, it is possible that "Activity1" is executed more than once (it is possible for the workflow process to loop back to a point above "Activity1", so that it could arrive at "Activity1" multiple times).


A couple of questions in regard to this:
If "Activity1" is encountered more than once in an instance of a process, how is this implemented - are they seen as 2 separate activities from the point of K2?

Further - keeping in mind that "Activity1" has a start rule, and won't start until a specific date, consider the following scenario:
"Activity1" is encountered, but doesn't start until STARTDATE1
The process continues ("Activity1" is still waiting to start) and "Activity1" is encountered again, but this time doesn't start until STARTDATE2 - and STARTDATE2 is a value that is BEFORE STARTDATE1

What would happen in this scenario? Do the 2 separate instances of "Activity1" complete as individual and un-related activities? Or would the second instance of "Activity1" complete, meaning that the first instance never completes?

Please let me know if any further clarification is needed, as I am finding this quite confusing, and am not sure I have explained my questions well enough...

Thanks in advance for any assistance!

It sounds like your process has parallel paths, so I will answer your questions under that assumption:


#1.  Activity1 would have two instances and they are independent.


#2  The two instances of Activity 1 are independent and would start at the appropriate STARTDATE.


Here are some general thoughts:


It is an error to use a STARTDATE that is in the past (before the current DateTime).


As you noticed at the end, this was difficult to explain.  As a general rule of thumb, if something is difficult to explain when it was created, it will be much more difficult to enhance and maintain in the future.  Is there a way to re-factor your logic to avoid this confusing scenario?


A great way to answer this type of question is just to try it out on your development system or a VPC.  Often times just trying something out can lead you to see it in a new way and generate other ideas.


David


Hi David,

Thanks again for the clarification - very much appreciated!

I appreciate the comments you made at the end, and have been trying to think of how to make the logic clearer, but so far haven't come up with a way of doing this. This is probably as a result of my limited experience with K2, so I will explain what I am trhing to achieve below, and if you feel you can add any ideas, I would very much welcome them...

The process that I have developed is an approval process for a document which has a specific lifetime (ie it has a valid from and a valid to date).
The process is started by a user filling in and submitting an infopath form. This form is then approved in parallel by a number of users.
Once the form has been approved, it waits until the ValidFrom date is reached, at which point it is published to a sharepoint document library, and becomes visible to users.
The form is then moved to an archive location when the "ValidTo" date is reached.

So far pretty simple, but the complication comes in as described below:
2 weeks before the ValidTo date is reached (or today if it is not valid for at least 2 weeks), a user is notified that the form will expire in 2 weeks. They have the option of choosing to have the form re-issued.
If they choose to re-issue the form, it goes through the same approval process, which I have implemented by looping back up to the appropriate activity in the process (see NOTE below)

This is where I potentially run into the problem that I was looking for clarification on - it is theoretically possible (although highly unlikely) that I may end with 2 documents which are waiting to be published or archived at the same time.

NOTE: Originally, I would have preferred to start an entirely new process for any re-issues of the form, rather than looping back to the top of the process, as this would have ensured that everything was kept completely separate. the reason that this wasn't done was because I could not work out how to programmatically submit the form, and have the process triggered again.

As I mentioned above, if you have any ideas on the best way to achieve this, I would love to hear them.

Thanks again for taking the time to answer my original question - I really appreciate it!


 


Reply