private void onBranchComplete(NativeActivityContext context, ActivityInstance completedInstance) {
		if (this.CompletionCondition == null || (Boolean) this.hasCompleted.get(context))
			return;

		if (completedInstance.getState() != ActivityInstanceState.Closed && context.isCancellationRequested()) {
			// NOTE how to reach here? parent called cancelChild()?
			// maybe fault and parent call cancel(this)
			// System.err.println("child in non-closed state! cancel ourselves");
			context.markCanceled();
			this.hasCompleted.set(context, true);
			return;
		}

		if (this.onConditionComplete == null) {
			this.onConditionComplete = new CompletionWithResultCallback<Boolean>() {
				@Override
				public void execute(NativeActivityContext context, ActivityInstance completedInstance, Boolean result) {
					onConditionComplete(context, completedInstance, result);
				}
			};
		}
		context.scheduleActivityWithResult(this.CompletionCondition, this.onConditionComplete);
	}