What is a Split N Activity?

The Split-n is used to copy an instance n times for processing purposes.

The easiest way to visualize how the Split-n activity operates is to picture a process that solicits bids from external vendors. The company wants to get multiple bids from different vendors and uses the BP-Method to select the lowest bid that meets the company's specifications.

BP-Method statements in the Split-n activity create the individual copy instances and set their respective instance variables. As an instance flows into a Split-n activity, the original instance automatically flows to the corresponding Join activity, while copies of the original instance are created. The original instance stays in the Join activity until all copy instances arrive. However, there are four exceptions to this rule:

The copy instances automatically inherit all the attributes of the original instance as they leave the Split-n activity. If end users add or change attachments of the copy instances, the attachments are automatically associated to the parent instance once they have reached the Join activity.

Note: You should be careful with the values of instance variables that may be changed within the Split-n / Join circuit since the original instance will take the value of the variable from the last copy instance to reach the Join activity, unless the Method in the Join activity dictates otherwise.

Activities within the Split-n / Join circuit cannot have any transitions to or from activities outside it. An exception to this rule is when you use a Grab activity that resides outside the Split-n circuit to handle overrun conditions within the Split-n / Join circuit.

Note: Grabbed instances can only be sent back to the activity from which they were grabbed or to the End activity. They can never be sent to another activity outside the Split-n / Join Circuit.

Using the Split N Activity

The following table outlines some of the considerations when using the Split N Activity within ALBPM Studio.

WorkSpace

The Split-n and Join activities are not visible in WorkSpace.

Roles

Split-n and Join activities reside in automatic roles. They can also reside in user-defined roles. However, no activity will appear in WorkSpace.

Variables

Split-n and Join activities can access instance, local and predefined variables from the BP-Method Editor.

Copies have to be created manually and not graphically as it occurs in the Split activity where each outgoing transition will produce a copy creation.

To create copies, you have to generate them in the Split-N BP-Method with the following code:

	i = 0
	while i < numOfCopies
	do
	    // create a copy of the process instance
	    copy= clone(this)
	
	    // Get ready for next loop
	    i = i + 1
	
	end
	

Join activities can also access instance copies by using copy. as shown below:

	// Set the original instance variable with the
	// copy instance variable
	bidTotal = copy.bidTotal
	
Pre Conditions

Split-n activities require an incoming instance from another activity in the process.

Join activities rejoin each instance copy reaching the Join activity (if the original instance is still there).

Post Conditions

Split-n: When an instance reaches a Split-n activity, the original instance is automatically sent directly to the corresponding Join activity. While still in the Split-n activity, instance copies are created and each copy flows across the path in the Split-n/Join activity circuit. The number of generated copies will depend on the number of copies generated using the variable "copy".

Join: The original instance can leave the Join activity due to one of these three reasons:


  • If the number of copies to wait to release property is set, the original instance leaves the Join activity after that number of copies have arrived to this activity. If it is not set, then,

  • After all instance copies have reached the Join activity, the instance moves to the activity following the Join activity according to transition rules.

  • When a copy reaches the Join activity and the Join's Method sets the predefined variable action to RELEASE (action = RELEASE).

  • When the original instance expires either because of a due transition or the process' Instance Expiration exception handling has occurred due to a missed process deadline.

Transitions

Split-n activities require at least one or more incoming transition(s). Only one outgoing transition is allowed.

Join activities must have only one incoming transition in a Split-n / Join circuit. One or more outgoing transition(s) are required.

Tasks

No tasks can be generated. A BP-method will be automatically created with the same name as that of the activity.

The Join Activity associated script will be automatically generated after you check the design. At that moment the Split-Join circuit is consolidated.

Business Process Methods

The Split-n / Join activity circuit creates copies of the original instance based on BP-Method logic. The Split-n activity creates the copies as shown in the following BP-Method:

	i = 0
	while i < numOfSuppliers
	do
	    // create a copy of the process instance for 
	    // this supplier's quote
	    copy= clone(this)
	    copy.supplier = "Supplier" + String(i)
	    copy.supplierNum = i
	
	    // Get ready for next loop
	    i = i + 1
	
	end
	
Note: If the instance has associated a Separated Instance variable, its value will not be automatically copied to the copies separated instance variable. Within the Split-N BP-Method, you have to assigned it manually (e.g., copy.separatedvariable = separatedvariable).

The Join activity acts as a marshaling point where each copied instance is used to update variables in the original instance. For example, the Join activity's BP-Method will contain lines like the following:

	// Take the copy instance variables and use them to set
	// original instance variables. Use ''copy.'' .
	
	supplierName = copy.supplierName
	costQuote = copy.supplierQuote