Example usage for javax.resource.cci InteractionSpec SYNC_SEND_RECEIVE

List of usage examples for javax.resource.cci InteractionSpec SYNC_SEND_RECEIVE

Introduction

In this page you can find the example usage for javax.resource.cci InteractionSpec SYNC_SEND_RECEIVE.

Prototype

int SYNC_SEND_RECEIVE

To view the source code for javax.resource.cci InteractionSpec SYNC_SEND_RECEIVE.

Click Source Link

Document

Interaction Verb type: The execution of an Interaction sends a request to the EIS instance and receives response synchronously.

Usage

From source file:com.spring.jca.tuxedo.Sample.java

@Test
public void levereraPerson() throws ResourceException, Ferror {
    try {//www .  jav  a2  s  . com
        TuxedoInteractionSpec spec = new TuxedoInteractionSpec();
        spec.setFunctionName("levereraPerson");
        spec.setInteractionVerb(InteractionSpec.SYNC_SEND_RECEIVE);

        SampleFldTbl sft = new SampleFldTbl();

        TypedFML32 in = new TypedFML32(sft);

        in.Fchg(sft.name_to_Fldid("RFV_ANVNAMN"), 0, "40042841");
        in.Fchg(sft.name_to_Fldid("RFV_ILOGGAD"), 0, 10);
        in.Fchg(sft.name_to_Fldid("RFV_BATCH"), 0, 1);
        in.Fchg(sft.name_to_Fldid("FML_PERSONNUMMER"), 0, "193801010269");

        TuxedoFML32Record recordIn = new TuxedoFML32Record(in);

        TypedFML32 out = new TypedFML32(sft);
        TuxedoFML32Record recordOut = new TuxedoFML32Record(out);

        template.execute(spec, recordIn, recordOut);

        TypedFML32 returnValue = recordOut.getFML32();
        int kundidID = sft.name_to_Fldid("FML_KUNDID");
        String kundid = (String) returnValue.Fget(kundidID, 0);

        System.out.println(kundid);
    } catch (TPException e) {
        System.out.println(e.getMessage());
    }
}

From source file:com.spring.jca.tuxedo.entity.TuxedoImpl.java

public String execute(String request) {
    try {//from w  ww . j  a va  2 s. co  m
        Map<String, Object> fields = parseRequest(request);

        TuxedoInteractionSpec spec = new TuxedoInteractionSpec();
        spec.setFunctionName(getFunctionName(fields));
        spec.setInteractionVerb(InteractionSpec.SYNC_SEND_RECEIVE);

        TypedFML32 out = new TypedFML32(sft);
        TuxedoFML32Record recordOut = new TuxedoFML32Record(out);

        template.execute(spec, getInRecord(fields), recordOut);

        String results = parseOutput(recordOut);
        System.out.println(results);

        return results;
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}