class AAICreateTasks {

    public void connectNetworkToNetworkCollectionInstanceGroup(BuildingBlockExecution execution) {
        try {
            ServiceInstance serviceInstance =
                    extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
            L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
            // connect network only if Instance Group / Collection objects exist
            if (serviceInstance.getCollection() != null && serviceInstance.getCollection().getInstanceGroup() != null)
                aaiNetworkResources.connectNetworkToNetworkCollectionInstanceGroup(l3network,
                        serviceInstance.getCollection().getInstanceGroup());
        } catch (Exception ex) {
            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
        }
    }

}