net.ibizsys.model.util.merger.wf.PSWFLinkListMerger Maven / Gradle / Ivy
package net.ibizsys.model.util.merger.wf;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import net.ibizsys.model.util.merger.IPSModelListMerger;
import net.ibizsys.model.util.merger.IPSModelMergeContext;
import net.ibizsys.model.util.merger.IPSModelMerger;
import net.ibizsys.model.util.merger.PSModelMergerFactory;
public class PSWFLinkListMerger extends net.ibizsys.model.util.merger.PSModelListMergerBase{
@Override
protected String getTagField(IPSModelMergeContext iPSModelMergeContext) {
return iPSModelMergeContext.getPSModelTagField(net.ibizsys.model.wf.IPSWFLink.class);
}
@Override
protected boolean isAppendChildOnly(IPSModelMergeContext iPSModelMergeContext) {
Boolean ret = iPSModelMergeContext.isAppendChildOnly(net.ibizsys.model.wf.IPSWFLink.class);
return (ret != null)?ret:super.isAppendChildOnly(iPSModelMergeContext);
}
@Override
protected boolean isEnableMergeChild(IPSModelMergeContext iPSModelMergeContext) {
Boolean ret = iPSModelMergeContext.isEnableMergeChild(net.ibizsys.model.wf.IPSWFLink.class);
return (ret != null)?ret:super.isEnableMergeChild(iPSModelMergeContext);
}
@Override
protected boolean isEnableMergeSingle(IPSModelMergeContext iPSModelMergeContext) {
Boolean ret = iPSModelMergeContext.isEnableMergeSingle(net.ibizsys.model.wf.IPSWFLink.class);
return (ret != null)?ret:super.isEnableMergeSingle(iPSModelMergeContext);
}
@Override
protected IPSModelMerger getPSModelMerger(IPSModelMergeContext iPSModelMergeContext, ObjectNode objectNode) throws Exception {
JsonNode typeJsonNode = objectNode.get("wFLinkType");
String strTypeValue = (typeJsonNode == null)?"":typeJsonNode.asText("");
switch(strTypeValue){
case "IAACTION":
return iPSModelMergeContext.getPSModelMerger(net.ibizsys.model.wf.PSWFInteractiveLinkImpl.class, false);
case "ROUTE":
return iPSModelMergeContext.getPSModelMerger(net.ibizsys.model.wf.PSWFRouteLinkImpl.class, false);
case "TIMEOUT":
return iPSModelMergeContext.getPSModelMerger(net.ibizsys.model.wf.PSWFTimeoutLinkImpl.class, false);
case "WFRETURN":
return iPSModelMergeContext.getPSModelMerger(net.ibizsys.model.wf.PSWFEmbedWFReturnLinkImpl.class, false);
default:
return iPSModelMergeContext.getPSModelMerger(net.ibizsys.model.wf.PSWFLinkImpl.class, false);
}
}
}