Ensemble ASTM Development Guide
Configuring the Production
[Back] [Next]
Go to:

This chapter describes how to configure a production to include an ASTM routing interface. It discusses the following topics:

This chapter discusses tasks that you perform on the [Ensemble] > [Production Configuration] page. The following chapter describes additional tasks.
Adding ASTM Business Services
Add one ASTM business service for each document type that the production will receive. If this document type arrives via multiple communication modes (for example, via FTP in addition to files), you will need a business service for each communication mode.
To add an ASTM business service to a production, use the Business Service Wizard as usual; see Configuring Ensemble Productions. Select one of the following classes from the Service Class list:
Business Service Variation (EOTOPTIONAL)
Ensemble also supports a mode in which it receives consecutive ASTM E1394 messages not separated by ENQ/EOT control characters but just run together on the wire over a TCP connection. To enable this mode, create a subclass of one of the preceding business service classes, and add the following to your subclass:
Parameter EOTOPTIONAL = 1;
Then use this subclass in your production.
Adding ASTM Business Processes
The ASTM device interface described in the first chapter uses a business process called WorkAndRouteProcess. A business process like this one inherits from EnsLib.MsgRouter.VDocRoutingEngine, just like the business processes that you would use for documents in the X12 format. For instructions to create one, see Adding an X12 Business Process in the Ensemble X12 Development Guide. Instructions for the routing rules and data transformations that might be required to support such a business process are also available in the same chapter.
The ASTM testing interface described in the first chapter uses a BPL business process called GenerateReplyProcess as its business process. The purpose of this business process is to generate an appropriate ASTM reply document, without actually connecting with a device. The source code for the sample BPL business process is as follows:
Class Test.ASTM.GenerateReplyProcess Extends Ens.BusinessProcessBPL

/// BPL Definition
XData BPL [ XMLNamespace = "http://www.intersystems.com/bpl" ]
<process language='objectscript'
         request='Ens.Request' response='Ens.Response'
         height='2000' width='2000' >
  <sequence xend='550' yend='300' >
    <assign name='CreateResponse' property='response'
            value='..%Process.NewResponse(request)' action='set'
            xpos='550' ypos='200' />

Method NewResponse(pDocIn As EnsLib.EDI.ASTM.Document)
       As EnsLib.EDI.ASTM.Document
 Do {
  Set tDocOut=pDocIn.NewReplyDocument(,,.tSC)  Quit:$$$ISERR(tSC)
  #; Create correct number of blank segment objects in the output document
  For i=1:1:4 {
   Set tSC=tDocOut.SetSegmentAt(##class(EnsLib.EDI.ASTM.Segment).%New(),i)
  } Quit:$$$ISERR(tSC)
 Set tSC=tDocOut.SetValueAt("H|\^&|||",1)
 Set tSC=tDocOut.SetValueAt("P|1|315186|SH3F040230||ARNOUTS^A||19261201|W|",2)
 Set tSC=tDocOut.SetValueAt("O|1|0058224303||^^^BH05|R||||||A||||||||||||||Q",3)
 Set tSC=tDocOut.SetValueAt("L|1|F",4)
 } While 0
 Quit tDocOut

Adding ASTM Business Operations
Add an ASTM business operation for each output destination. You might also want to add a business operation to handle bad messages.
To add an ASTM business operation to a production, use the Business Operation Wizard as usual; see Configuring Ensemble Productions. Select one of the following classes from the Operation Class list:
Connecting the ASTM Business Hosts
After you add the ASTM business hosts, connect these items as follows:
Configuring the Business Hosts
You should examine all the settings listed in Reference for Settings and set them as needed.
A couple of key settings for an ASTM business service are as follows:
When ASTM is the protocol, a business operation needs a partner business service before it can initiate an outbound transmission to the device. The basic integration tasks are as follows: