class AAIUpdateTasks {

    public void updateNetworkUpdated(BuildingBlockExecution execution) throws Exception {
        L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID);
        L3Network copiedl3network = l3network.shallowCopyId();
        UpdateNetworkResponse response = execution.getVariable("updateNetworkResponse");
        try {
            copiedl3network.setNeutronNetworkId(response.getNeutronNetworkId());
            aaiNetworkResources.updateNetwork(copiedl3network);

            Map<String, String> subnetMap = response.getSubnetMap();
            List<Subnet> subnets = l3network.getSubnets();
            if (subnets != null && subnetMap != null) {
                for (Subnet subnet : subnets) {
                    Subnet copiedSubnet = subnet.shallowCopyId();
                    copiedSubnet.setNeutronSubnetId(subnetMap.get(copiedSubnet.getSubnetId()));
                    copiedSubnet.setOrchestrationStatus(OrchestrationStatus.CREATED);
                    aaiNetworkResources.updateSubnet(copiedl3network, copiedSubnet);
                }
            }
        } catch (Exception ex) {
            logger.error("Exception occurred in AAIUpdateTasks updateNetworkUpdated", ex);
            exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
        }
    }

}