class AAICreateTasks {

    public void createNetworkCollection(BuildingBlockExecution execution) {
        try {
            ServiceInstance serviceInstance =
                    extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
            Collection networkCollection = serviceInstance.getCollection();
            // pass name generated for NetworkCollection/NetworkCollectionInstanceGroup in previous step of the BB flow
            // put shell in AAI
            networkCollection.setName(execution.getVariable(NETWORK_COLLECTION_NAME));
            aaiNetworkResources.createNetworkCollection(networkCollection);
        } catch (Exception ex) {
            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
        }
    }

}