Getting Test Socket status in batch mode
Hi!
I´m running multiple UUT´s in the standard batch model.
I need to find a way to get a teststep running in one test socket to know the current status (passed, failed, terminated etc.) for all other test sockets.
Is this possible?
One solution might be to have each test socket to store the context pointer (CAObjHandle seqContextCVI when using LabWindows) to an array at the beginning of each test socket and then access each others test socket context. This way it might be possible if there is a context value or string to look for. Is this a good idea at all or are there better solutions?
/ Roine
Hi,
this would in fact be better in the TestStand discussion group.
However, there are several options available to you.
The first is to use queues. They're in the synchronisation menu. That way you can make sure you don't write to the same variable from two different threads before a third one has read it.
The second option is to store the seqContext pointer, however, this pointer is only a reference to where you currently are, i.e. if you start flying around launching other threads, then your seqContext might not be correct at that time
The third option is the hardest to implement. In the batch process model, the execution handles that are involved in the launching of Test UUT -- Test Socket Entry Point, are stored in a FileGlobal to the processmodel : FileGlobals->TestSocketExecutions. However, when you're in your sequence file, and you look at Runstate.Root.FileGlobals.TestSocketExecutions, it's empty. This is because that array hasn't been set as shared. So the top level Test UUT's can see it, but since we're launching executions, we cannot see it. So in the processmodel, you have to find the fileglobals, find the TestSocketExecutions, go to it's properties, and then hit the advanced button. Go down that list, and look for the property flag for shared at run-time.
That way, Runstate.Root.FileGlobals.TestSocketExecutions will have an array of execution reference handles.
From this handle, there's a method of the execution object to get a thread. This is where it's difficult, since you might not know which thread you're trying to get hold of. Once you have one of those, you can get the seqeuence context for that thread, and then you can (get using that as a property object), the number, string etc, from the other thread.
The last option is simply to share (as in option 3, but in the client sequence file) a variable, however, you can easily run into the problem you see in option 1 since the resource is like using station globals. There's no marshalling system to make sure things are written to before they're read from.
Hope that helps
Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer
Similar Messages
-
Disable a test socket during execution (Batch Mode)
We are running a Batch Model with Batch Synchronization. I am wondering if it is at all possible to totally disable one or more of the test socket during execution. I know that the opening screen allows you to choose which sockets are active, but in the event that something goes astray like the RS-485 communication is non-responsive, I would like to disable one or more at anytime during the test. Thank you in advance for any ideas you come up with.
Regards
Scott
Environment: TestStand 2010
Solved!
Go to Solution.I am not aware of how to stop a socket which is already running and facing an error midway.
But this setting will ensure that the socket is disabled for the next runs.
1) Override the preBatch callback.
2) Call this statement in the current executing thread to stop the socket from next run. ( precondition = on error)
RunState.Caller.Parameters.ModelData.TestSockets[RunState.TestSockets.MyIndex].Disabled=True -
Get work process table in batch mode
I need to get the content of sm50 periodically in a shell script using dpmon. Is there any way to run dpmon in batch mode to get the work process table ? The dpmon utility provides an inactive way to get the work process table, dpmon ->m ->p but don't see a way to run this in a shell script.
Does anyone a transparent table (exists in oracle) in sap, which has the work process information ?
JayHi Jay,
Could you let us know how your issue was solved?
Because I am facing the same issue..I want to get the output of dpmon in batch form, using scripts...
When I tried to check the reply "echo "q" | /sapmnt/$/exe/dpmon pf=/sapmnt/$/profile/$_$_$ p", I found that ultimately the cursor does not come out of the interactive mode...This is my main issue...How to come out of the interactive mode of dpmon...Could anyone help me with this?
Thanks & Regards,
Kunal Patel -
Getting a COM error when calling MenuItemExecute in batch mode
I support an internal document management system for our corporate contracts. Among other applications, I have one that runs nightly in batch mode to store new invoices and connect them via bookmarks to their corresponding “parent” contract files. The original program was created in 2005 with Acrobat 7 (later updated to Acrobat 8) and it worked well for several years. However, a few months ago I upgraded the system to Acrobat 9 and since then the program has not run consistently.
The “program” actually consists of a VB application and two plug-ins. The VB application does as much work as it can with IAC and the JSO bridge, but because the files are (owner) password protected one plug-in automatically applies the necessary password using AVDocDidOpen when the VB application opens the AVDoc. The VB application then also calls the other plug-in using MenuItemExecute. The second plug-in is used to create the bookmarks between the two files by grabbing info off bookmark strings and creating the necessary actions. It also applies the password to the files.
Here is brief outline form is how this is all structured:
pdDocParent.Open
pdDocInvoice.Open
avDocParent.Open (This triggers the first plug-in to apply the password)
Create bookmark strings in both files using JSO bridge
MenuItemExecute (To create the bookmark action in the parent)
pdDocParent.Save
avDocParent.Close
avDocInvoice.Open (This triggers the first plug-in to apply the password)
MenuItemExecute (To create the bookmark action in the invoice)
pdDocInvoice.Save
avDocInvoice.Close
pdDocInvoice.Close
pdDocParent.Close
Since the upgrade, I’m getting a COM error [The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))] on a non-consistent basis when the application tries to call MenuItemExecute. When I say “non-consistent” I mean that some days the program will process several hundred files just fine. Other days it won’t process any. Then some days it will not process the first, oh, four files but will process the next 300. Usually it runs fine when started interactively, but even then the error sometimes occurs.
I recompiled both plug-ins and the VB app using the Acrobat 9 SDK (headers for the plug-in and the Acrobat type library for the VB app) but that didn’t make any difference. I added code to check if the MenuItem is available and it is in all cases.
After reviewing this more, I got to thinking that perhaps a race condition was the culprit—that a string hadn’t been completely written before the second plug-in tried to create an action for it. So I added some half-second pauses along the way, but that doesn’t seem to have helped, either.
At this point the only thing I can think of is to rewrite the application as a pure plug-in. But it’s a long and involved application and if I can get the current app to work I’d prefer to do that. I tested it with Acrobat 10.1 and encountered similar problems.
As I said, it’s been working fine up until Acrobat 9. Does anyone know of anything that might have changed with Acrobat 9 that I haven’t considered? Is there anything else I might check? Thanks.Leonard,
I'd be interested in hearing why you think that because others at Adobe have told me it's OK. Acrobat is only being called by one user at a time and we've paid for a full license.
Thanks,
Dick -
Get individual test socket execution reference
Hi All,
Versions used: LV 2014, TS 2014, Parallel model with each DUT independently tested, Custom OI built as per need
I have an application where at most 8 test sockets can run at a time, independent of each other. Each DUT must be independently started, paused or aborted from LabVIEW custom OI. How do I get the individual test socket execution reference so that I can send the pause/abort command from LabVIEW Operator Interface? I tried using the FileGlobals.TestSocketExecutions array from the Parallel model (by setting "Shared at Run-time" flag), but these references seems to be changing constantly.
What I want to do is have a unique execution reference for each testsocket that can be obtained when the DUT is started/ even when the testsocket is spawned, store that reference in my LabVIEW code and use this execution reference when I want to pause/abort the testing in that particular socket from LabVIEW OI.
Thanks in advance,
SaranyaSaranya,
I assume (hope) that you are using the "Test UUTs" execution entry point in the parallel model. So it seems to me that you already disabled the "UUT Info Dialog", otherwise you would have blocking functionality which requires user interaction on the UI dialog.
Please look into the Parallel Model as well as the modelsupport2.dll sources (available as CVI project in TS model folder) how the synchronization is done there.
Hint: There is a queue....
Also, i hope that you mixed abort with termination. I highly recommend you to never abort executions.
Norbert -
Sharing a communication object between test sockets
Hi everyone, I am having some trouble using teststand in batch mode as it is my first time doing so. Here is my question:
I am creating a test sequence that uses multiple test sockets. I am using a switching matrix that is controlled over ethernet to allow me to connect different loads to the hardware under test. I only have one load, but I have several different devices that need to connect to that load for the tests to be run, and they can only be connected one at a time.
My approach was to initilaze the connection to the switching matrix and store the resulting object reference as a global variable, which allows me to send commands to the switch matrix from any sub-sequence. I then created another sub sequence for the load tests called "External Load Tests". In this step, the load is connected to the hardware via the switching matrix, and tests are run. I am using batch mode, so I put a lock on the "External Load Tests" sub sequence so that only one thread can enter at a time.
This sequence works if there is only one active test socket. If there is more that one, the first thread will get inside the external "External Load Tests" step and try to send a command to the switch matrix using the object reference that I mentioned. However, when this happens, the step hangs indefinitely until the other threads are manually stopped. It seams like the thread isnt being given access to the switch matrix object, becuase usually if there is an error the switch matrix driver throws an exception, but in this case it just hangs.
Any ideas on how I can fix this? I don't have a lot of experience with multi threading, so any advice would be greatly appreciated.
Thanks!For the batch model you could use a serialized batch synchronization section rather than a lock. A lock should also work though, it just doesn't guarantee that all threads get to the section before any of them continue and doesn't guarantee the order like batch synchronization does. Typically you should use all default settings for the batch model (other than perhaps number of sockets). Which setting did you change? The 'Default Batch Synchronization' setting? You should typically leave this as "Don't Synchronize". Setting this to Parallel makes it synchronize at every step which requires all sockets to get to each step before any of them to continue. This is not the behavior that people typically want. In most cases you should use the default of "Don't Synchronize" and then set synchronization manually in your sequence where you want it, either using the step synchronization settings, or the batch synchronization step types, or other synchronization step types such as locks.
Hope this helps,
-Doug -
Disabling Test Sockets in SinglePass.
I am new to TestStand and LabWindows and am trying to figure out how to
pass serial number and socket status to a sequence file from a
LabWindows application. I have an application that successfully opens a
sequence file and executes it via the TestStand API. I can probably
figure out a way to pass serial numbers and socket status via the
Parameters.ModelData.TestSockets[x] sub property. The problem is that
it appears that SinglePass is waiting for all the test sockets to
complete whether they are enabled or not. It seems to never get out of
the step "Wait For TestSockets" under the SinglePass entry point.
Is there an easy way to do this? I really don't want to use the
TestUUT's entry point. Should I just customize the SinglePass entry
point with logic in the "Wait For TestSockets" loop or is there a
much easier way to do this?
Thanks,
JohnHello John,
To answer your first question, generally to pass information
back and forth between an operator interface and a sequence you should have
your sequence post a UIMessage, and your operator interface reads the message
and responds. If you look at the
PostUIMessage help you see the following definition:
Thread.PostUIMessageEx ( eventCode, numericDataParam,
stringDataParam, activeXDataParam, synchronous)
You can pass data with the message, and since the
activeXDataParam is passed by reference you can update the value and use it in
your sequence file. This is how you
could send a serial number between the Operator interface and the sequence
file.
Next, you mention that you are having problems with test
sockets waiting for disabled test sockets. I think this is probably due to
how the disabled flag is being set. We
have been able to disable a test socket if the user does not type in a serial
number (in the batch process), by modifying the batchuutdlg.c in the
modelsupport2.prj. We first declared a
variable static char string[200]; and in the goCallback we added the following
instead of the statement at line 932.
GetCtrlVal(childPanel,
panelData->testSocketDataArray[i].ctrls[kTSCtrl_SerialNum], string);
if (!strcmp(string, ""))
tsErrChkMsgPopup(
TS_PropertySetValBoolean (panelData->testSocketDataArray[i].testSocket,
&errorInfo, TEST_SOCKET_DISABLED, 0, (VBOOL)(VTRUE)));
I hope you find this example helpful.
Regards,
Jesse O
Applications Engineering
National Instruments
Jesse O. | National Instruments R&D -
How to change Number of test socket in Model option during run-time
I wanna be able to change the the number of test sockets(in the Model Options menu) during runtime. I have overriden the Prebatch callback and used my own instead. I have a LabView program in my Prebatch where I would select the test script each time before running the batch. I wann be able to also modify the number of test sockets each time before I run the batch again. I tried setting the "Parameters.ModelData.ModelOptions.NumTestSockets" from the Labview program which is in my Prebatch before running each batch, but get into errors. Please help?
Hello Kumar,
The Batch process model shipped with TestStand does not handle this scenario, but you can still do this. Attached is a sequence file that utilizes the Batch Model's ProcessCleanup callback to reset the next execution point. It still uses the method of setting the Parameters.ModelOptions.NumTestSockets variable in the PreBatch callback. The change I added was three steps to a different callback (the ProcessCleanup callback):
Message Popup - prompts Yes or No to continue testing with a new batch size.
Statement 1 - based on the response to the message popup (via precondition), resets the Batch Model's next step to be executed and the ContinueTesting flag:
RunState.Root.RunState.StepGroup = "Setup"
RunState.Root.RunState.NextStepIndex = 0
RunState.Root.Locals.ModelData.ContinueTesting = True
Statement 2 - based on the response to the message popup (via precondition), loops to reset each TestSocket's ContinueTesting flag:
RunState.Root.Locals.ModelData.TestSockets[RunState.LoopIndex].ContinueTesting = True
These two statement steps force the next step to be executed in the Batch Process Model to be the first step in the "Setup" step group, and reset all necessary flags for the batch itself and the individual TestSockets. I discovered the flags that had to be reset by trial-and-error (that was the time-consuming part).
You can run continuous batches of the same size you first chose (for as long as you like), but when stop the batch execution this new message popup will prompt (yes/no) whether you want to continue testing with a new batch size. If no, then processing terminates. If yes, then the next two statement steps are run and execution resumes back at the beginning of the Batch Process Model's Setup step group. This forces the ModelOptions callback to be executed again, so your VI (in my example here it's just a Message Popop) can then set NumTestSockets appropriately.
Thanks for contacting National Instruments!
David Mc.
NI Applications Engineering
Attachments:
kumar.seq 27 KB -
Download created XML File in batch mode // Parse XML file into single lines
Hello!
I upload a CSV file and based on that CSV file I create an XML "object". First I uploaded and downloaded it via gui frontendclass, but as it has to be run in a batch in the night I need to upload and download the data via OPEN DATASET.
The import and transformation of the CSV file works fine, also the transfer into an itab with the same structure as a CSV line is ok. I also create the XML file, which could be downloaded easily with gui-download but it is not permittet.
Import of data: I scan the folder and get the filenames into a itab, I loop over that itab and read the single files like this:
OPEN DATASET ls_convert_batch FOR INPUT IN TEXT MODE ENCODING DEFAULT.
CLEAR tab.
IF sy-subrc = 0.
DO.
READ DATASET ls_convert_batch INTO line.
IF sy-subrc <> 0.
EXIT.
ELSE.
CLEAR tmptab.
SPLIT line AT ';' INTO tmptab-product
tmptab-contract
tmptab-extagent.
APPEND tmptab TO tab.
ENDIF.
ENDDO.
ENDIF.
The XML file has a strucutre like
<file>
- <file formant_no="1.1" format_date="02.10.2003">
<status>V</status>
<number>001001025</numbner>
<name>Schmeisser,Christof</name>
- <details>
- <detail>
<contract>00000003494</contract>
<name>Schmeisser, Christof</name>
<invoice_no>000000003840</invoice_no>
<due_date>20100601</due_date>
<amount>140,00</amount>
</detail>
- <detail>
<contract>00000003495</contract>
<name>Schmeisser, Christof</name>
<invoice_no>000000003841</invoice_no>
<due_date>20100601</due_date>
<amount>130,00</amount>
</detail>
- </details>
<elements>2</elements>
<amount_overall>270</amount_overall>
</file>
At the moment I download it like this:
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = l_xml_size
filename = filename
filetype = 'BIN'
* CONFIRM_OVERWRITE = '0'
CHANGING
data_tab = l_xml_table
EXCEPTIONS
OTHERS = 24.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSEIF sy-subrc = 0.
lv_create_counter = lv_create_counter + 1.
ENDIF.
But I need to download it via OPEN TRANSFER CLOSE Dataset as it has to run in batch mode.
Anyone has an idea? I am really desperate here. One idea would be to parse the single lines into a string and then create the XML file line by line as text and save it with ending XML, should work. But I don't know how!
Thank you very much in advance,
kind regards from Tallinn, Estonia,
Christof!
Edited by: Christof Schmeisser on Nov 25, 2010 7:51 PM
I edited the heading, would be too general and missleading!Tipos Pools
TYPE-POOLS: ixml.
CLASS cl_ixml DEFINITION LOAD.
TYPES: BEGIN OF xml_node_type,
node TYPE char50,
vlnode TYPE string,
END OF xml_node_type,
BEGIN OF xml_line_type,
data(256) TYPE x,
END OF xml_line_type.
Tabelas Internas
DATA: ti_xml_node TYPE TABLE OF xml_node_type.
Variáveis TYPE REF
*Type REF para utilizar no XML
DATA: ixml_type TYPE REF TO if_ixml,
streamfactory_type TYPE REF TO if_ixml_stream_factory,
ostream_type TYPE REF TO if_ixml_ostream,
istream_type TYPE REF TO if_ixml_istream,
parser_type TYPE REF TO if_ixml_parser,
renderer_type TYPE REF TO if_ixml_renderer,
document_type TYPE REF TO if_ixml_document,
encoding_type TYPE REF TO if_ixml_encoding,
node_type TYPE REF TO if_ixml_node,
element_dtrans_type TYPE REF TO if_ixml_element,
element_xml_in_type TYPE REF TO if_ixml_element,
element_roteiros_type TYPE REF TO if_ixml_element,
element_roteiro_type TYPE REF TO if_ixml_element,
element_vias_type TYPE REF TO if_ixml_element,
element_via_type TYPE REF TO if_ixml_element,
element_dummy_type TYPE REF TO if_ixml_element,
gw_xml_node TYPE TABLE OF xml_node_type,
gw_xml_node_ret TYPE TABLE OF xml_node_type,
gw_xml_node_err TYPE TABLE OF xml_node_type,
gw_xml_node_xml TYPE TABLE OF xml_node_type,
gw_xml_table TYPE TABLE OF xml_line_type,
gw_xml_table2 TYPE TABLE OF xml_line_type,
gs_xml_node TYPE xml_node_type, "WA para leitura do xml
gs_xml_node_ret TYPE xml_node_type, "WA para leitura do xml retorno
gs_xml_node_err TYPE xml_node_type, "WA para leitura do xml erro
gs_xml_node_xml TYPE xml_node_type, "WA para leitura do xml info sucesso
gs_xml_table2 TYPE xml_line_type. "WA para importar xml
Variáveis do Programa
DATA: l_value TYPE string,
l_rc TYPE i,
l_xml_size TYPE i,
cod_cartaorepom TYPE char20 VALUE '123456789',
v_caminho_exp TYPE string VALUE 'C:TEMP',
v_salvaarquivo TYPE string,
v_nomearquivo TYPE string,
w_nodetext TYPE string,
v_roteiros TYPE string,
v_roteiro TYPE string,
v_roteiro_codigo TYPE string,
v_percurso_codigo TYPE string,
v_percurso_descricao TYPE string,
v_cidade_origem TYPE string,
v_estado_origem TYPE string,
v_cidade_destino TYPE string,
v_estado_destino TYPE string,
v_transporte_tipo TYPE string,
v_cartao_taxa TYPE string,
v_cobra_taxa TYPE string.
Constants
CONSTANTS: cc_39 TYPE string VALUE '39', " Numero 39.
cc_dt_trans TYPE string VALUE 'data_transfer'," document_type(name)
cc_metodo_cod TYPE string VALUE 'metodo_codigo'," document_type(name)
cc_xml_in TYPE string VALUE 'xml_in'," document_type(name)
cc_ct_tx_ativ TYPE string VALUE 'cartao_taxa_ativacao'," document_type(name)
cc_cartao TYPE string VALUE 'cartao', " Parâmetro Perform.
cc_xml TYPE string VALUE '.XML'," extenção
cc_bin TYPE char10 VALUE 'BIN'." filetype
START-OF-SELECTION.
PERFORM yf_inicia_criacao_xml USING cc_39.
element_roteiro_type = document_type->create_simple_element(
name = cc_ct_tx_ativ
parent = element_xml_in_type ).
PERFORM yf_dummy_roteiro USING cod_cartaorepom cc_cartao.
PERFORM yf_finaliza_xml.
PERFORM yf_exporta_xml USING v_caminho_exp.
PERFORM yf_convert_xml_to_itab TABLES gw_xml_node_ret
USING v_salvaarquivo.
END-OF-SELECTION.
*& Form yf_inicia_criacao_xml
text
-->VALUE(P_0783) text
FORM yf_inicia_criacao_xml USING value(p_0783).
DATA: s_encoding_type TYPE string VALUE 'ISO-8859-1'.
Cria o ixml factory
ixml_type = cl_ixml=>create( ).
*Cria o objeto com modelo
document_type = ixml_type->create_document( ).
*Cria o cabeçalho encoding="iso-8859-1"
encoding_type = ixml_type->create_encoding( byte_order = 0
character_set = s_encoding_type ).
*Cria o root "DATA_TRANSFER"
element_dtrans_type = document_type->create_simple_element(
name = cc_dt_trans
parent = document_type ).
*Cria o node "METODO_CODIGO" e preenche com um valor passado no L_VALUE
l_value = p_0783.
CONDENSE l_value.
element_dummy_type = document_type->create_simple_element(
name = cc_metodo_cod
value = l_value
parent = element_dtrans_type ).
*Cria o node "XML_IN"
element_xml_in_type = document_type->create_simple_element(
name = cc_xml_in
parent = element_dtrans_type ).
ENDFORM. " yf_inicia_criacao_xml
*& Form yf_dummy_roteiro
text
-->VALUE(P_0996) text
-->VALUE(P_0997) text
FORM yf_dummy_roteiro USING value(p_0996)
value(p_0997).
l_value = p_0996.
CONDENSE l_value.
element_dummy_type = document_type->create_simple_element(
name = p_0997
value = l_value
parent = element_roteiro_type ).
ENDFORM. " yf_dummy_roteiro
*& Form yf_finaliza_xml
text
FORM yf_finaliza_xml.
*Cria o stream factory
streamfactory_type = ixml_type->create_stream_factory( ).
*Conecta a internal table de XML com o stream factory
ostream_type = streamfactory_type->create_ostream_itable( table = gw_xml_table ).
CALL METHOD ostream_type->set_encoding
EXPORTING
encoding = encoding_type.
*Rendering the document
renderer_type = ixml_type->create_renderer( ostream = ostream_type
document = document_type ).
l_rc = renderer_type->render( ).
*Salva o documento XML
l_xml_size = ostream_type->get_num_written_raw( ).
ENDFORM. " yf_finaliza_xml
*& Form yf_exporta_xml
text
-->VALUE(P_0783) text
FORM yf_exporta_xml USING value(p_0783).
CONCATENATE cod_cartaorepom
sy-datum
sy-uzeit
cc_xml
INTO v_nomearquivo.
CONCATENATE p_0783
v_nomearquivo
INTO v_salvaarquivo.
TRANSLATE v_nomearquivo TO UPPER CASE.
*Exporta o XML
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
bin_filesize = l_xml_size
filename = v_salvaarquivo
filetype = cc_bin
CHANGING
data_tab = gw_xml_table
EXCEPTIONS
OTHERS = 24.
IF sy-subrc = 0.
PERFORM yf_sapgui_progress_indicator USING cc_msg_xml_ok.
ELSE.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " yf_exporta_xml
*& Form yf_convert_xml_to_itab
text
-->P_GW_XML_NODE_RET text
-->P_FILENAME text
FORM yf_convert_xml_to_itab TABLES p_gw_xml_node_ret LIKE gw_xml_node
USING p_filename.
DATA l_count.
ixml_type = cl_ixml=>create( ).
Now Create Stream Factory
streamfactory_type = ixml_type->create_stream_factory( ).
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = p_filename
filetype = cc_bin
IMPORTING
filelength = l_xml_size
CHANGING
data_tab = gw_xml_table2
EXCEPTIONS
OTHERS = 19.
IF sy-subrc = 0.
istream_type = streamfactory_type->create_istream_itable( table = gw_xml_table2
size = l_xml_size ).
document_type = ixml_type->create_document( ).
parser_type = ixml_type->create_parser( stream_factory = streamfactory_type
istream = istream_type
document = document_type ).
IF parser_type->parse( ) NE 0.
IF parser_type->num_errors( ) NE 0.
l_count = parser_type->num_errors( ).
ENDIF.
ENDIF.
CALL METHOD istream_type->close( ).
CLEAR istream_type.
node_type = document_type.
PERFORM yf_get_data USING node_type.
p_gw_xml_node_ret[] = gw_xml_node[].
CLEAR gw_xml_node[].
ENDIF.
ENDFORM. " yf_convert_xml_to_itab
*& Form yf_get_data
text
-->VALUE(X_NODE) text
FORM yf_get_data USING value(x_node) TYPE REF TO if_ixml_node.
DATA: indent TYPE i.
DATA: ptext TYPE REF TO if_ixml_text.
DATA: string TYPE string.
DATA: temp_string(100).
CASE x_node->get_type( ).
WHEN if_ixml_node=>co_node_element.
string = x_node->get_name( ).
w_nodetext = string.
CLEAR string.
string = x_node->get_value( ).
IF NOT w_nodetext IS INITIAL OR
NOT string IS INITIAL.
gs_xml_node-node = w_nodetext.
gs_xml_node-vlnode = string.
IF NOT gs_xml_node-vlnode IS INITIAL.
APPEND gs_xml_node TO gw_xml_node.
CLEAR gs_xml_node.
ENDIF.
ENDIF.
ENDCASE.
Get the next child
x_node = x_node->get_first_child( ).
Recurse
WHILE NOT x_node IS INITIAL.
PERFORM yf_get_data USING x_node.
x_node = x_node->get_next( ).
ENDWHILE.
ENDFORM. "yf_get_data -
Help needed in consuming BTQueryAUI query in batch mode
Hi Friends,
I am trying to consume BTQueryAUI in a custom function module. I have a requirement where in when i receive a external ref nbr, i need to update the status of crm service request to completed. We have already built logic to store the external nbr info in AET field on Service request and enhance inbox search to take give the results accordingly. now when i try to consume the query service with standard query parameters in batch mode..its not working..
REPORT ZTEST_CSOCRM.
DATA : ob_oref TYPE REF TO zcl_im_z_badi_inbox_search,
C_ITEM_1O TYPE CRMT_AUI_MAP_ITEM_TYPE VALUE 'ONEORDER',
l_param1o_tab TYPE crmt_name_value_pair_tab,
is_name type standard table of CRMT_NAME_VALUE_PAIR,
wa_name like line of is_name,
l_sort_1o_tab TYPE crmtt_aui_sorting,
lv_result_1o TYPE REF TO cl_crm_bol_entity_col.
data QUERY_1O type ref to CL_CRM_BOL_QUERY_SERVICE.
CONSTANTS:
abap_true TYPE abap_bool VALUE 'X',
abap_false TYPE abap_bool VALUE ' '.
data: c_BTQueryAUI TYPE crmt_ext_obj_name
VALUE 'BTQueryAUI',
c_query1o TYPE crmt_ext_obj_name VALUE 'BTQueryAUI',
ob_query TYPE REF TO
cl_crm_bol_query_service,
ob_result TYPE REF TO if_bol_bo_col,
ob_core TYPE REF TO cl_crm_bol_core,
lr_aui_dq TYPE REF TO cl_crm_aui_advquery_service,
lr_aui type ref to cl_crm_aui_query_service.
wa_name-name = 'ASSIGNEDTYPE'.
wa_name-value = '0000'.
append wa_name to is_name.
wa_name-name = 'DATETYPE'.
wa_name-value = '0001'.
append wa_name to is_name.
wa_name-name = 'MAINCATEGORY'.
wa_name-value = 'ZBGW'.
append wa_name to is_name.
wa_name-name = 'SORTEDBY'.
wa_name-value = '0000'.
append wa_name to is_name.
wa_name-name = 'SORTEDBY2'.
wa_name-value = '0000'.
append wa_name to is_name.
wa_name-name = 'TIMEPERIOD'.
wa_name-value = '0000'.
append wa_name to is_name.
wa_name-name = 'ZZFLD000006'.
wa_name-value = '0000012345'.
append wa_name to is_name.
wa_name-name = 'DESCRIPTON'.
wa_name-value = '*test*'.
append wa_name to is_name.
l_param1o_tab = IS_NAME.
ob_core = cl_crm_bol_core=>get_instance( ).
ob_core->start_up( 'ALL' ).
TRY.
query_1o = cl_crm_bol_query_service=>get_instance( c_query1o ).
CATCH: cx_crm_unsupported_object.
ENDTRY.
query_1o->set_query_parameters( EXPORTING it_parameters = l_param1o_tab
iv_convert = abap_false ).
lv_result_1o ?= query_1o->get_query_result( ).
ob_query = cl_crm_bol_query_service=>get_instance( c_BTQueryAUI ).
ob_query->set_query_parameters( EXPORTING it_parameters = l_param1o_tab
iv_convert = abap_false ).
lv_result_1o ?= ob_query->get_query_result( ).Tried obtaining the output using SQL and the result is as follows:
SQL> WITH T AS
2 (
3 SELECT 1 COL1 FROM DUAL
4 UNION
5 SELECT 2 COL1 FROM DUAL
6 UNION
7 SELECT 3 COL1 FROM DUAL
8 UNION
9 SELECT 4 COL1 FROM DUAL
10 UNION
11 SELECT 5 COL1 FROM DUAL
12 UNION
13 SELECT 8 COL1 FROM DUAL
14 UNION
15 SELECT 9 COL1 FROM DUAL
16 UNION
17 SELECT 10 COL1 FROM DUAL
18 UNION
19 SELECT 13 COL1 FROM DUAL
20 UNION
21 SELECT 14 COL1 FROM DUAL
22 UNION
23 SELECT 15 COL1 FROM DUAL
24 UNION
25 SELECT 16 COL1 FROM DUAL
26 UNION
27 SELECT 23 COL1 FROM DUAL
28 UNION
29 SELECT 24 COL1 FROM DUAL
30 )
31 SELECT OUTPUT FROM
32 (
33 SELECT DECODE(COL3,NULL,COL1, COL2) || '-' || LEAD(DECODE(COL3,NULL,COL3, COL1)) OVER (ORDER BY DECODE(COL3,NULL,COL1, COL2)) OUTPUT FROM
34 (
35 SELECT COL1, LEAD(COL1) OVER (ORDER BY COL1) COL2, LAG(COL1) OVER (ORDER BY COL1) COL3 FROM T
36 )
37 WHERE
38 (COL2 - COL1 > 1 OR COL2 IS NULL OR COL3 IS NULL)
39 )
40 WHERE OUTPUT != '-';
OUTPUT
1-5
8-10
13-16
23-24 -
Photoshop CS3 Actions Batch mode bug?
I posted this in the Mac forum but received no responses after a couple of days, so I am trying it here.
Photoshop CS3 Actions seem to have a bug such that when used in Automate > Batch mode it will use the name of the first file opened in the batch session for every file processed in that session. Since that name is used in Save step, this means having to deal with the "File Already Exist" dialog for every file in the batch because it is attempting to save at the designated location with the same file name. If the continue option is chosen each time, the final result is one file with the first opened file name, but with the contents of the last processed file.
To confirm that this is a problem particular to the opening step, I have disabled all processing steps as well as the saving step by toggling them in the Actions panel. I then ran the action in batch mode on a folder containing 4 files. This resulted in 4 opened files all with the same name but different image content.
This was with the "Override 'Open' Action Commands" checked/not checked, and the "Suppress File Open Options Dialogs" checked/not checked. The problem described also occurs when using a Droplet.
By comparison, Photoshop CS exhibits the expected behavior: when an action is used in batch mode to process an entire folder of files, the name of each file is retained after opening and used after processing in the save or export step.
The above described behavior of CS3 is a change acquired along the way to the CS3 version (I do not have the CS2 version to test). But more importantly, can someone please report if the CS4 version behaves as I described for CS3, or if it has been returned to the CS behavior?
OS X 10.4.11
G4 800 MHz 2 MB L3/processor 1.25 GB SDRAM
Is this a known bug?
AlHello Miguel,
I was going to come back to post some of my findings, one of which relates to your staement:
"- The open command created by Photoshop 6 doesn't keep the file's name, it is a much simple open command, and so it opens the file with the own file's name."
In my case I found that my CS version of the "same" action worked, while the CS3 version failed, precisely because the earlier one records less detail for the open step.
My need is to convert dozens of Quark pdf files to GIF and JPEG files for the web. What I found after several days of testing is that it is best to record the opening step in CS3 NOT using a pdf file, so that the "Open As Generic Pdf with 'Name____' " would not be coded into the opening step. Instead I recorded the whole action using a PSD file. Then I can proceed to run it in Batch mode choosing a folder of Quark pdf files as the source location with "Override 'Open' Action Commands" checked, and the "Suppress File Open Options Dialogs" checked, and it opens all the pdf files just fine in some background process, not getting stuck in the details of the file name, and proceeds to cary out the flattening, saving, and closing steps to my chosen target location and uses the finder file name of each pdf files in the source folder to save a filename.ext in the Target folder.
Contrary to what I stated in my original post, "Override 'Open' Action Commands" checked/not checked does indeed make a difference. If it is not checked, the files do open in batch mode, but the other steps are not performed. There is much more about this that I would like to know, and this may not be a general solution for all types of files that a user may wish to process in batch mode, but it works for my case. The main trick is to use as simple an opening step as possible when recording the action, and then letting Photoshop use whatever background process it requires to open a particular file type. I tested this by manually saving a pdf file to each of the twenty some odd formats available in the save as dialog to a Source folder, and then proceeded to batch process that folder with the action described above, and it worked for all except one.
So while there may not be a bug involved in this problem, there certainly is a lack of documentation about how the "improvements" in the opening step in newer versions of Photoshop affect using Actions in Batch mode.
Please comment if you can further explain any of the reported results. In particular, what is the situation in CS4?
Thanks,
Al -
Estimatedrowcount not working in Batch mode
We have a page where we conditionally display navigation buttons based on whether a view's estimated row count is gt 10 rows. This is done via JSTL. Prior to getting to the page, a data-action refreshes the three views. In Batch mode, when we re-enter this screen a second time, all views return the estimated row count of RANGESIZE rows. If we reset the iterator range size to 6 or 7, the second time in, it would return 6 or 7 rows and the buttons would be GONE.
Interestingly enough, the dataaction displays the view object's getEstimatedRowCount(), and it is ALWAYS correct, however the front end does not work.
When we switch to IMMEDIATE mode, it works fine, however IMMEDIATE mode breaks another part of our application, where we attempt to find a row in an iterator inside of a data action. Of course, that section works fine in BATCH mode, but no IMMEDIATE.
We saw a thread out there on Metalink regarding this last issue - that setCurrentRowWIthKey returns a JBO-25020 in 10.1.2 in IMMEDIATE mode, but there was no solution.
Are there some words of advice for this sync mode issue and ways to resolve issues like this?
Again, assistance would be GREATLY appreciated!!!!Are you using the parameter 'INSERT' in 'SAVE_TEXT' FM?
The module can be used to change existing texts and to create new texts. If it is clear that it is a new text, this can be specified via the parameter INSERT. The result is better performance as a test read is not performed. -
How to add print buttons in teststand batch mode
Does anyone know how to add "print test report" buttons to the final test status dialog box in TestStand batch mode?. It would be nice to have a print button for each DUT and also a "print all" button to print all of the reports for the batch.
Hi Hollister,
I found this example program titled "Programmatic Printing of TestStand Reports - Modular". It should give you some of the functionality you need while giving you a good springboard to customize it for your specifications.
Cheers,
KyleP
Applications Engineer
National Instruments -
PreparedStatement in batched mode gives Exception
Hi
I have a problem.
I am running PreparedStatement in batched mode, actually I am using Springs BatchSQLUpdate component.
Now i am creating a batch of about 10000 inserts / updates. However if any single of these inserts / updates fails, it gives exception with DataIntegrityViolation, BadSQLGrammer etc.
I am also maintaining a parallel cache of the values that I am using to bind the preparedstatements.
So for statement 1 in the batch, i know what values are being used.
My question is when the batch update fails, how can we identify which SQL statement, i mean which index in the batch caused the issue?
Please help me as I am stuck and need to build some robust exception handling for PreparedStatement batch loads.
NikiNiki-Nono wrote:
The insertPreparedStatements.get() in my code returns a BatchSqlUpdate object which has already been assigned a statement and also have passed the array of object values to it.
I have done this using batchSqlUpdate.update(objects); where objects is an array of values.
THe code block that I executes the flush(). This throws an exception. In some cases it is a BadSQLGrammerException for cases where we try to insert alphabets in integer columns or in some cases DataIntegrityViolation where the batch has 2 sets of values with same primary key.
The results array is null when i check the value in the catch block.
And the flush() does not proceed with execution of the complete batch in fact it aborts when even 1 statement fails.
I hope it is clearer now.
However, if all the statements go through, I have seen that the results array has correct values as to how many rows were updated / inserted.
Please let me know.OK, I really wasn't sure about what it did on flush, as there's no explicitly stated exception and nothing in the method description. The array will be null since it hasn't been set with the return value from flush since an exception was thrown.
From what I can tell this Spring class uses, under the hood, the batch functionality from JDBC. So the particular exceptions you;re getting will have started life as SQLExceptions...which themselves will be of the BatchSQLException I mention in my first post. I'm wondering if the Spring exceptions contain the SQLException. I would hope so, and I have a vague recollection that the original is wrapped so you should be able to do something along the lines of:
catch (DataAccessException ex)
SQLException ex = ex.getCause();
if (ex instanceof java.sql.BatchUpdateException)
// Get the info from here.
}Now, this is only a concept, and I haven't tested it or anything, but I would hope something along these lines should get you to the data you're after. -
Batch mode & ClassCastException question
Hi
I'm using JDev 10.1.2.1 (1913) and have a problem with a JClient app using batch mode.
The issue started when I decided to use ranges on my JTable. In sync=Immediate mode the JTable would render with data equaling the number of records requested from my VO plus empty rows (my NextSet and PrevousSet operation buttons made sets appear and disappear in existing rows of the table). For example, picture a table with 100 records and a VO tuned to request in batches of 10. My JTable would render with 10 rows displayed and 90 empty rows. When I click NextSet, the first 10 rows go blank and the next 10 appear. Obviously this is not desired behavior.
Ok, so I decided to try "Batch" mode which cause the jTable to operate correctly but it causes ClassCastException errors when calling custom VO methods. Since I make sure to cast to interfaces and not implementations (per Steve's article: http://www.oracle.com/technology/products/jdev/tips/muench/batchmode/index.html) I don't understand why I'm getting these.
Here's a test case to demonstrate:
1) New Project - Connection: SCOTT
2) Create EmpVO - Select * from EMP
3) Tune EmpVO - Batches of 5, as needed; Fill Last Page unchecked
4) Edit EmpVO class. Create custom method
public String toString()
return "Custom method: " + getClass().toString();
5) Shuttle method to selected for Client Interface (interface EmpVO generated and automatically implemented by EmpVOImpl)
6) Create EmpAppMod - Assign EmpVO
7) Create runnable Panel from VO (Swing/JClient for ADF; template=Table)
8) Modify panel by adding new panel (Constraints = SOUTH) and dragging "NextSet" and "PreviousSet" Operations from the EmpVO1 data control onto new panel as buttons
9) Under the panel's UIModel you'll see two iterators for the same VO (one for the jTable and one for the buttons). Check the range sizes, the table iterator should be set to -1 and the button iterator to 5 (matches the VO's batch retrieve section).
10) Edit panel code and add a call to the custom VO method in main():
System.out.println(((EmpVO)panel.getPanelBinding().findIterBinding("EmpVO1Iter").getViewObject()).toString());
11) Set Sync=Immediate for the AppMod DC in DataBindings.cpx
12) Run panel
Hopefully you'll see the blank row behavior described above and the custom toString() result printed to the console.
Again, if batch mode works I don't care about this jTable problem.
Now set Sync=Batch and re-run the panel. In my version the jTable works as expected but I get the ClassCastException...even though I'm casting to the EmpVO interface. In my real application this means I can't call any of my custom VO methods.
Exception:
Exception in thread main
java.lang.ClassCastException: oracle.jbo.common.ws.WSViewObjectImpl
at mypackage9.PanelEmpVO1.main(PanelEmpVO1.java:95)
If anyone has a suggestion on how to make this work (in either sync mode) pls let me know.
thanks
Johnthanks but I don't understand. I thought I was using the client interface. The call to oracle.jbo.common.ws.WSViewObjectImpl is not being done by me.
I found another thread (Re: ClassCastException: WSViewObjectImpl where Steve M. says do access the VO interface in batch mode like so:
ApplicationModule am = (ApplicationModule) actionContext.getBindingContext().findDataControl("YourDataControlName").getDataProvider();
YourCustomViewObject vo = (YourCustomViewObject) am.findViewObject("view1");
I'm using a JClient panel to call the custom method so my code is:
ApplicationModule am = (ApplicationModule)panel.getPanelBinding().getBindingContext().findDataControl("EmpAMDataControl1").getDataProvider();
EmpVO ep = (EmpVO)am.findViewObject("EmpVO1");
ep.toString();
Both the default ApplicationModule and custom EmpVO are interfaces but I still get the ClassCastException
I don't know if this helps, but if I create a method in my AppMod that calls the custom VO method I don't get the error....but that can't be right - I shouldn't have to create AppMod methods for all custom VO methods. Obviously I missing something fundamental
Maybe you are looking for
-
Using ASA 5510 and router for dual WAN Connections.
Guys, neeed some help here: Context: 1- My company has one ASA 5510 configured with Site-to-site VPN, Ipsec Cisco VPN and AnyConnect VPN. 2- We use ASA to connect to the single ISP (ISP 1) for internet access. ASA does all the NATing for internal use
-
Webkit2webprocess is consuming a lot of memory in safari 5.1
Well I got this problem but the solution is to select in Safari- Tools:-Preferences -. Safety then to disable Pugins,Java,Java environment well this can cause problems to open some pages or videos unless you get back to the previous status....but i t
-
Envelop header for HTTP receiver adapter
Hi, In one of the business scenario's XI has to send data to an external party using an envelope header(Sample document to be sent is given below.) <b>Message-ID:ABC.JavaMail.SYSTEM@ztxwmwspro02 Date: Thu, 16 Oct 2003 17:02:04 -0400 (EDT) Mime-Versio
-
Linux webcam resolution in flash
Hello I am using PartyBooth software (www.partyboothapp.com) that I purchased through adobe AIR. This is a simple application that lets you use a webcam to run a photobooth. I have 3 cameras that are very well supported in Linux: 1) Logitech Webcam
-
Raw material not using for production
Dears I have a raw material which will be a line item for different FERT But some particular FERT i don't want to this raw material is use for costing and planning and consumption Please tell me how we can map this I try in BOM Item status we can se