Inclusion and exclusion
Your logic seems good. The problem statement was a tough to understand, but I think I got it. 

Since inclusion and exclusion do not change, we should extract that checking from the loop and place it before the loop. 

Furthermore, to reduce programmer errors, I reduced the code duplicity. The "do whatever you want" is now only typed once, and the regex pattern is only typed once.

String tempPattern = "(^|.*;)" + temp + "(;.*|$)";

boolean tempInInclusionOrNotInExclusion;
if(inclusion != null &amp;&amp; !inclusion.trim().isEmpty()){
    tempInInclusionOrNotInExclusion = inclusion.matches(tempPattern);
} else if(exclusion != null) {
    tempInInclusionOrNotInExclusion = !exclusion.matches(tempPattern);
} else {
    tempInInclusionOrNotInExclusion = true;
}

for(PdsxAttrKey key: pdsxWriteRequest.getAttrKeys()){
    boolean shouldDoWhatIWantToDo;
    if(key.equals("156") || key.equals("155")) {
        shouldDoWhatIWantToDo = tempInInclusionOrNotInExclusion;
    } else {
        shouldDoWhatIWantToDo = true;
    }

    if(shouldDoWhatIWantToDo){
        //Check the PdsxAttrValue has a Synthesizer
        if(metadata!=null){
            Synthesizer synthesizer = metadata.getSynthesizer();
            if(synthesizer!=null){
                //Synthesize the attribute
                PdsxAttrValue synthesizedVal = synthesizer.synthesize(key, record);
                //if(synthesizedVal!=null){
                val = synthesizedVal;
                //}
            }
        }
        if(val!=null){
            writeRecord.getAttrs().put(key, val);
        }
    }
}