How-To Set CICS Header Properties

In some cases, there is a need to add specific properties to the CICS header we are sending to our adapter.

Some of these properties can be written in the CICS SDK application YAML. These properties are specific for each SDK project, and some are specific per each entity.

This guide will show how to set properties in the OL CICS Header.

 

After generating the Entity go to the entity java class.

For example:

 

package com.mf_test.openlegacy; import org.openlegacy.core.annotations.rpc.Action; import org.openlegacy.core.annotations.rpc.Languages; import org.openlegacy.core.annotations.rpc.RpcActions; import org.openlegacy.core.annotations.rpc.RpcEntity; import org.openlegacy.core.annotations.rpc.RpcField; import org.openlegacy.core.annotations.rpc.RpcNavigation; import org.openlegacy.core.rpc.actions.RpcActions.EXECUTE; @RpcNavigation(category = "") @RpcEntity(name="Itemde", language=Languages.COBOL) @RpcActions(actions = { @Action(action = EXECUTE.class, path = "ITEMDET", displayName = "Execute", alias = "execute" ) }) public class Itemde { @RpcField(originalName = "DFHCOMMAREA", displayName = "Dfhcommarea") private ItemdeDfhcommarea dfhcommarea; }

 

To set properties in the OL CICS Header, you need to modify the RpcActions annotation the following way:

@RpcActions(actions = { @Action(action = EXECUTE.class, path = "ITEMDET", displayName = "Execute", alias = "execute" , //This is the part you need to add actionProperties = { @ActionProperty(name = [FieldName], value = "[YOUR VALUE]") } ) })

 

We allow setting the following Fields:

 

public final class MFInternalHeaderNames { private MFInternalHeaderNames() { } public static final String TRANSACTION_TOKEN_KEY = "transactionToken"; public static final String TRANSACTION_NAME_KEY = "transactionName"; public static final String TRANSACTION_OPTION_KEY = "transactionOption"; }

 

Where the transaction option field can be configured with the values “0”,”1”,”2” and “3”, this will be then translated to the following in our adapter: