How can I create a function using TestStand variables and call it from a step's Pre-Expression?
In one sequence I have dozens of Pre-Expressions which are almost the same thing, like this...
Locals.tagID = (Parameters.singlePhaseEnabled ? "L" : "D") & Str(Locals.phase) & "006"
...and the only thing different is that three digit string at the end ("006" will vary). How can I write a function that I can call from a step's Pre-Expression so it would look something like this? ...
Locals.tagID = MyNewFunction("006")
You cannot write custom commands for expressions.
That being said, there are a couple of options:
Create a subsequence with a single step. Use a parameter of the sequence as "function parameter".
Create a custom step type including a substep module which implements the function. Add an edit substep to enable the user of the steptype to gracefully change the parameter.
Store the variable parameter in a local/file global variable and modify the value in each step. This will, at least, keep the "function" the same for every step.
Norbert
Similar Messages
-
How can I deploy a simple stateless ssion EJB and call it from a standalone client
Hi,
I'm creating s simple staless session EJB that has a method that takes a name and prints "Hello" + name. This EJB is in a package called "com.demos.mydemo.ejbs.hello"
How can I deploy this to OC4J?
How can I call it from a standalone client(no JSP, no servlets)?
In Sun's J2EE is very easy to deploy and I don't have to know any XML stuff.
can I use the .ear file created by the Sun's "deploytool" to deploy my EJB to OC4J?
This is the code at I'm using and it works on Sun's j2sdkee1.2.1:
///////// Remote /////////
package com.demos.mydemo.ejbs.hello;
import java.rmi.RemoteException;
import javax.ejb.EJBObject;
public interface Hello extends EJBObject {
public String sayHello(String name) throws RemoteException;
///////// Home //////////
package com.demos.mydemo.ejbs.hello;
import java.rmi.RemoteException;
import javax.ejb.EJBHome;
import javax.ejb.CreateException;
public interface HelloHome extends EJBHome {
public Hello create() throws CreateException, RemoteException;
/////////// Bean class ///////////
package com.demos.mydemo.ejbs.hello;
import java.rmi.RemoteException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import javax.ejb.CreateException;
import javax.ejb.EJBException;
import java.sql.Connection;
import java.sql.SQLException;
//import java.sql.PreparedStatement;
import javax.sql.DataSource;
import javax.naming.NamingException;
import javax.naming.InitialContext;
public class HelloEJB implements SessionBean {
private SessionContext context;
private Connection con;
private String dbName =
"java:comp/env/jdbc/Oracle";
public HelloEJB() {}
public void setSessionContext (SessionContext context) {
this.context = context;
public void ejbCreate() throws CreateException {
try {
makeConnection();
catch (Exception e) {
System.err.println("HelloEJB: exception in ejbCreate:" + e.getMessage());
e.printStackTrace();
throw new CreateException(e.getMessage());
public void ejbActivate() {
public void ejbPassivate() {
public void ejbRemove() {
try {
con.close();
catch (SQLException ex) {
throw new EJBException("HelloEJB: exception in ejbRemove: " + ex.getMessage());
public String sayHello(String name) {
return "Hello " + name;;
private void makeConnection() throws NamingException, SQLException {
try {
InitialContext ic = new InitialContext();
DataSource ds = (DataSource) ic.lookup(dbName);
con = ds.getConnection();
catch (Exception e) {
System.err.println("HelloEJB: exception in makeConnection:" + e.getMessage() );
e.printStackTrace();
//////////// EJB client that uses a stateless session bean
package com.demos.mydemo.ejbs.hello;
import java.io.*;
import java.sql.*;
import javax.sql.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
public class HelloClient {
public static void main(String[] args) {
try {
Context initial = new InitialContext();
Object objref = initial.lookup("HelloSession");
HelloHome home = (HelloHome)PortableRemoteObject.narrow(objref,HelloHome.class);
Hello h = home.create();
String msg = h.sayHello("John Doe");
System.out.println(msg);
//h.remove();
} catch (Exception ex) {
System.err.println("Caught an exception." );
ex.printStackTrace();
Thanks
Nabil
null<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Nabil Khalil ([email protected]):
I deployed and .ear file created by Sun's J2EE deployment tool on the OC4J. It looks that it was deployed fine -- did not get a deployment error.
When I run the client I'm getting the following error: Caught an exception.
javax.naming.CommunicationException: Can't find SerialContextProvider
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:60)
at com.sun.enterprise.naming.SerialContext.<init>(SerialContext.java:79)
at com.sun.enterprise.naming.SerialInitContextFactory.getInitialContext(SerialInitContextFactory.java:54)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:668)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.init(InitialContext.java:222)
at javax.naming.InitialContext.<init>(InitialContext.java:178)
at com.equifax.fms.ejbs.hello.HelloClient.main(HelloClient.java:18)
This makes me think that the client can't see the deployed EJB on the OC4J.
How can I fix this problem?
Thanks
Nabil
<HR></BLOCKQUOTE>
Nabil -
Your standalone client needs to obtain certain server-dependent properties. You can provide them in your code or grab them via a properties file.
For Orion - you need essentially the following setup, filling in your own information...
Define your standalone client class with "main" etc (this is orion specific - should work for 9i AS as well - perhaps there are some differences)
public class SomeClass {
try {
Properties p = new Properties();
p.setProperty("java.naming.factory.initial",
"com.evermind.server.ApplicationClientInitialContextFactory");
p.setProperty("java.naming.security.principal","server_admin_name");
p.setProperty("java.naming.security.credentials","server_password");
// THEN you can get your intitial context reference
InitialContext initial = new InitialContext (p);...........
Then go about your business.....
A good book to get is called "Professional Java Server Programming J2EE Edition" - there happens to be a reasonable amount of Orion/OCJ4 centric information since one of the authors is Karl Avedal - one of the principals behind Orion. Go out to java.sun.com and look at some of the J2EE tutorials - unfortunately a lot of it is hidden behind the J2EE Deployer, but you will get a good sense of what goes into outside-the-container standalone clients.
null -
How can i create splash screen using netbean?
how can i create splash screen using netbean?
Welcome to the Sun forums.
gabbyndu wrote:
how can i create splash screen..Java 6 offers a splashscreen functionality. See [New Splash-Screen Functionality in Java SE 6|http://java.sun.com/developer/technicalArticles/J2SE/Desktop/javase6/splashscreen/] *(<- link)* for details.
[Java Web Start|http://java.sun.com/javase/technologies/desktop/javawebstart/index.jsp] has offered splash screens to applications since Java 1.2. See [How can I provide my own splash screen?|http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/faq.html#206] in the JWS FAQ for more details.
.. using netbean?We don't support Netbeans here. Ask that on a [Netbeans forum|http://forums.netbeans.org/]. -
Certain Numbers templets allow you to drag and drop contacts to populate cell data, how can I create that functionality in my own tables?
If you haven't come across the workarounds thread you may find helpful tips there on this and other ways to work with Numbers 3.
ronniefromcalifornia discovered how to bring contacts into Numbers 3. As described in this post:
"Open Contacts
Select all the cards you want
Copy
In Numbers, in a table, select cell A1
Paste
Boom. Works great. Even brought in the pictures. Cool."
So instead of drag and drop, just select in Contacts, copy, and paste into Numbers
SG -
How can i create slaes order using BAPI
hi all,
i didnt work on BAPIS .how can i create sales order using BAPI here i should pass Z values.
Moderator message : FAQ, search for available information. Thread locked.
Edited by: Vinod Kumar on Sep 13, 2011 12:22 PMHi!
There are a lot of answered threads regarding your question. Try searching first. Below is a sample link.
BAPI_SALESORDER_CREATEFROMDAT2
Regards,
Steph
Edited by: stephquion on Sep 13, 2011 8:25 AM -
How can I create DVD Label using Photoshop Elements 10?
How can I create DVD label using Photoshop Elements 10?
RichardYou can create the design for a DVD label in Create>More Options. Once you have the label set up, you would copy it to a template for the labels you plan to use. (The PSE template makes one label, while most printed labels are two-up.)
-
How can I create back up dvds for itunes and how do I back up from existing dvds?
How can I create back up dvds for itunes and how do I back up from existing dvds?
Recovery Mode:
1. Turn off iPad
2. Connect USB cable to computer; leave the other end alone
3. Press and hold the Home button down and connect the docking end of cable to iPad
4. Continue holding the Home button until you see the "Connect To iTune" screen
5. Release the Home button
6. Open iTune
7. You should see "iTunes has detected an iPad in recovery mode"
8. Use iTune to restore iPad
Note: You need to be patient and repeat the above many times to recover your iPad -
How can I create a disk image of snow leopard installer disk from my Imac which runs it?
how can I create a disk image of snow leopard installer disk from my Imac which runs it? It came without DVD installer, and I want to make a copy of it's OS installer but can't find out how.
You need to have the disc in order to create disk image of snow leopard installer disc. What did your machine ship with? If something later than SL, then why? If earlier, then you can buy the SL installer disc and make the disk image.
-
How can I create an iBook using iBooks Author using images from a PDF?
I have a complex book with custom fonts and lots of images, and the client wants it on the iPad. So my most reasonable option seems to be to take images from a PDF and use them for the pages. However, images in iBook Author don't get "laid out" as expected in Portrait mode. How can I create a layout that is essentially one image per page in portrait mode, and then convert that to landscape mode? Or is there an easier way to go about this?
tk0us wrote:
Make sure you have disabled portrait in the Inspector.
I don't understand why portrait mode defaults images and other "widgets" to thumbnails. The original format of the book (and of 99% of all books I'm guessing) is in portrait format. By forcing the book to work only in landscape mode it's forcing the page image to be half the size, and that makes using this book particularly difficult. Is there no way to force the pages to be full-size in portrait mode? -
How can we create info record using IDOC INFREC?
Hi Friends,
Can we create info record using IDOC INFREC. If Yes. How?
Regards,
NarendraUsing IDOC INFREC & FM IDOC_INBOUND_SINGLE
-
How can I create a widget using a visual different from its parent?
Hi All:
I have a 8-bit-depth shell widget, how can I create a child widget using 24-bit-depth visual, the child is a XmDrawingArea. I cannot set XmNvisual.
But why GLwCreateMDrawingArea() can?
Thanks?Move your formulas in a non header column.
In the cell A2 of the table "aux", the formula is :
=IF(ISBLANK(main :: A2),"",main :: A2)
then I applied Fill Down.
Yvan KOENIG (VALLAURIS, France) mardi 2 août 2011 15:07:54
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community
To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer ! -
How can I create a custom field in contacts and have it appear in ICal?
How can I create a custom field in contacts (death date) and have it appear in calendar?
Birthdays seems to work fine but I'd like to do the same for a custom field called Date of DeathBy default, iTunes convert files to type AAC which has an extension of .m4a
For iTunes to recognize them as Audiobook files, the extension needs to change from .m4a to .m4b
This can be done a number of different ways. Here are 2 (beginner and advanced)
. simply, by renaming each file from windows explorer
. more complex, by using Start/Run/cmd to get a "DOS" type window,
using the command "cd" to change to the directory that your files are in
and entering "ren *.m4a *.m4b" -
How can I create a function of sound volue from time using AudioQueueBufferRef??
I have a question how can I analyze class AudioQueueBufferRef, for creating a function of sound volue from time?? Here is what I get . there is AudioQueueBufferRef fillBuf = audioQueueBuffer[fillBufferIndex]; volume height is 2000 elements from SInt16* coreAudioBuffer = (SInt16*)fillBuf->mAudioData. so function looks like H(t*i)=coreAudioBuffer[i] where t = 1/sampleRate = 1/22050 but here is a problem. my program gets sound and uses a class AudioStreamer for this. AudioStreamer has 3000 lines when I play music from Free Internet Radio - SHOUTcast Radio - Thousands of Free Online Radio Stations. internet radio - my problem is as follows either I dont know where 85 % of sound information is or I dont know how I can analyze class AudioQueueBufferRef
Here is the code where I analyze Buffer.
{@synchronized(self)
if ([self isFinishing] || stream == 0)
return;
inuse[fillBufferIndex] = true; // set in use flag
buffersUsed++;
// enqueue buffer
AudioQueueBufferRef fillBuf = audioQueueBuffer[fillBufferIndex];
fillBuf->mAudioDataByteSize = bytesFilled;
// ======>in this place I analyze Buffer
if (packetsFilled)
err = AudioQueueEnqueueBuffer(audioQueue, fillBuf, packetsFilled, packetDescs);
else
err = AudioQueueEnqueueBuffer(audioQueue, fillBuf, 0, NULL);
when bitRate = 24 buffer has the following options int size=(fillBuf->mAudioDataByteSize) == 2000 double sampleRate=asbd.mSampleRate == 22050 numberOfChannels = asbd.mChannelsPerFrame == 1 it turns out that duration of play buffer float bufferTime =(size/numberOfChannels)/sampleRate == 0.1 number of buffers per second float numBuffersInOneSeconds == 1,5 duration of play all buffers per one second numBuffersInOneSeconds * time == 0.15 so it is 15 % of all information
as a result If buffer comes at 0.0 seconds he lasts up to 0.1 seconds.farther in my function there is no volume. second buffer comes in 0.7 seconds and lasts up to 0.8 seconds. but in reality the sound doesnt breaks. Maybe I'm doing something wrong .please tell me.
just for comparison
when bitRate = 32 buffer has the following options int size=(fillBuf->mAudioDataByteSize) == 2000 double sampleRate=asbd.mSampleRate == 22050 numberOfChannels = asbd.mChannelsPerFrame == 1 it turns out that duration of play buffer float bufferTime =(size/numberOfChannels)/sampleRate == 0.1 number of buffers per second float numBuffersInOneSeconds == 2 duration of play all buffers per one second numBuffersInOneSeconds * time == 0.2 so it is 20 % of all information
when bitRate = 32 buffer has the following options int size=(fillBuf->mAudioDataByteSize) == 1660 double sampleRate=asbd.mSampleRate == 44100 numberOfChannels = asbd.mChannelsPerFrame == 2 it turns out that duration of play buffer float bufferTime =(size/numberOfChannels)/sampleRate == 0.02 number of buffers per second float numBuffersInOneSeconds == 10 duration of play all buffers per one second numBuffersInOneSeconds * time == 0.2 so it is 20 % of all informationYou cannot write custom commands for expressions.
That being said, there are a couple of options:
Create a subsequence with a single step. Use a parameter of the sequence as "function parameter".
Create a custom step type including a substep module which implements the function. Add an edit substep to enable the user of the steptype to gracefully change the parameter.
Store the variable parameter in a local/file global variable and modify the value in each step. This will, at least, keep the "function" the same for every step.
Norbert -
How can we create Query by using SQVI
Hi Frendz,
I need to generate a report by using SQVI hw can i do that, i want each step wise( I dont know how to do that even begining also), Pl send reply ASAP.
Thanks
Babu RaoDear Babu rao
Normally, SQVI will be used to join multiple tables. Go to SQVI and do the following:
1) Give some description in "Quickview"
2) Click "Create" button
3) Give some description in "Title"
4) From the tab "Data Source", select "Table Join" and click blue tick
5) Press "Shift + F1"
6) Give the table you wanted and press enter
7) Again Press "Shift + F1"
8) Again give the table you wanted and press enter
9) Press F3
10) On your left screen you can see those two tables with header "List fields" and "Selection Field"
11) Whatever data you want to give as input, (say for example based on sales organisation, you want some report), select the white box under selection field
12) Whatever data you want as report format, select those fields under List fields
13) Execute the report
thanks
G. Lakshmipathi -
How Can implement the audit function using toplink?
My system must record all the modification, how can I use toplink to implement it.
I know when toplink modify some object, the toplink will check how many attribute
have been modified, and then update it to database, Can I implement the record when
the toplink check modification?
PS: I dont want to use database trigger.
Thank first!!This thread has been inactive for a while, so perhaps I'm missing something. I am attempting to create audit events on domain objects using a TopLink 10.1.3 DescriptorEventAdapter.
These audit events mutate or create a snapshot collection on the domain object. Based on what I understand from the above thread, do I still need to create another UoW to commit these in my preInsert()/preCreate() handler methods?
Is there a way to get in the game before the IDs are assigned to the objects and the change set is computed?
I certainly don't claim to fully understand the historical client session docs. However, one of our requirements is to show object-attribute-level deltas (list chronologically, grouped by transaction, the attributes that have changed, who changed them, etc. with their before and after values). So my first-blush reaction is that it's easier to utilize the change set to create a collection of transactionally-grouped audit objects on the domain.
Thanks much,
--Todd Fredrich
Maybe you are looking for
-
HT1660 I want to pick up the music on my iphone to my ipod how do i do this?
I have just bought an ipod nano and want to import my music from my iphone on to it how do I do this
-
Hi, I am successfully using ObjectSharingInformation.GetObjectSharingInformation to get AnonymousEditLink property but I can't figure out how to use the same function to get AnonymousViewLink property it is always coming out as null does anyone know
-
Crover - generate OS version numbers for Arch Linux
Arch is a rolling distro, but did you ever wish it still had release numbers? So you could check what "version" you currently have installed, and upgrade to the latest "version" if necessary, with a reasonable delay between versions? Of course you di
-
Zebra Printer GK320d is Printing only one label
Hi All, We are using Printer Zebra GK420d for printing WIP completion label, however All our three zebra gk420d printers stops printing with "printer busy" after the one label print. We've reset the printer and then it'll print first label fine, when
-
I have more actions than are visible when I open the list ... How can I view the entire collection of 2,000 preset actions ???