FTL Realm Server Connection

Generated Objects

@Property(name = "MyFtlServerRealm")
public FTLRealmServerConnectionResource myFtlServerRealm;
private Realm myFtlServerRealmFtlRealm;

myFtlServerRealmFtlRealm is an instance of com.tibco.bw.sharedresource.ftl.rumntime. FTLRealmServerConnectionResource and myFtlServerRealmFtlRealm are instances of com.tibco.ftl.Realm. You can use these objects to communicate with FTL.

Business Logic Example

	class MyFtlSendActivityExecutor implements Runnable {

		/**
		 * <!-- begin-custom-doc -->
		 * 
		 * <!-- end-custom-doc -->
		 * @generated
		 */
		@Override
		public void run() {
			if(getActivityLogger().isDebugEnabled()) {
				activityLogger.debug(RuntimeMessageBundle.DEBUG_PLUGIN_ACTIVITY_METHOD_CALLED
									,new Object[] { "Executor run()"
									,activityContext.getActivityName()
									,activityContext.getProcessName()
									,activityContext.getDeploymentUnitName()
									,activityContext.getDeploymentUnitVersion() });
				String serializedNode = XMLUtils.serializeNode(inputData, processContext.getXMLProcessingContext());
		    	activityLogger.debug(RuntimeMessageBundle.DEBUG_PLUGIN_ACTIVITY_INPUT, new Object[] {activityContext.getActivityName(), serializedNode});
			}
			
			try {				

							
										// begin-custom-code
										// add your own business code here

					String endpoint = myFtlServerRealm.getApplicationName();
				EventQueue eventQueue = null;
				Publisher pub = null;
				Message msg = null;
				try {
					eventQueue = myFtlServerRealmFtlRealm.createEventQueue(FTL.createProperties());
					pub = myFtlServerRealmFtlRealm.createPublisher(endpoint);
					msg = myFtlServerRealmFtlRealm.createMessage(null);
					msg.setString("message", "Hello World!");
					pub.send(msg);
					eventQueue.dispatchNow();
				} catch (FTLException e) {
					throw new ActivityFault(activityContext, e);
				} finally {
					if (eventQueue != null) {
						eventQueue.destroy();
					}
				}
							// end-custom-code
						
					
				N output = null;
				SerializableXMLDocument<N> wrapper = new SerializableXMLDocument<N>(processContext.getXMLProcessingContext(), output);
				notifier.setReady(wrapper);
			} catch (Exception e) {
				e.printStackTrace();
				notifier.setReady(e);
			}
		}
	}