[Javassist user questions] - How do I automate close of Windows comand line Interface?
by leaustin
When script below runs, the Windows CLI remains open until manually closed. I want to run as a background process but, need to force the CLI to close once the command has executed to prevent the process from hanging. Any/All suggetions appreciated.
Thanks, lea
main();
function main()
{
// get contents of the \\stlmombhftp1\MKSTest\Outbound folder and load into array fc
var fso, f, f1, fc, intIndex;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder("//stlmombhftp1/MKSTest/Outbound");
fc = new Enumerator(f.files);
// for each file found in array fc, attach to the issue, copy file to the
// \\stlmombhftp1\MKSTest\ArchiveOutbound and remove from \\stlmombhftp1\MKSTest\Outbound.
for (; !fc.atEnd(); fc.moveNext())
{
// extract the filepath from \\stlmombhftp1\MKSTest\Outbound forward and extract the ID number
// from the filename and create the file destination variable for later use in moving the file.
var strfilepath = fc.item();
var strfilesource = String(strfilepath);
var strfilename = String(strfilepath);
intIndex=strfilename.lastIndexOf("RP");
strfilename=strfilename.substr(intIndex);
var strid=strfilename.substr(2,4);
// write the cli command and execute.
var strcli = "im editissue --port=7001 --hostname=stlmoapp07 --user=MKSScript --password=P2bbl357 --addAttachment='" + strfilepath + "' " + strid;
var WshShell = new ActiveXObject("Wscript.Shell");
var oExec=WshShell.Exec(strcli);
// WScript.Echo(strcli);
// oExec.StdOut.ReadAll();
// move the file to the ArchiveOutbound directory and remove from the Outbound directory
var strfiledest=strfilesource.substr(0,23) + "ArchiveOutbound\\" + strfilename;
var strfiledup=strfilesource.substr(0,23) + "ArchiveOutbound\\Dup" + strfilename;
if (fso.FileExists(strfiledest)) {
if (fso.FileExists(strfiledup)) {
fso.CopyFile(strfilesource,strfiledup);
fso.DeleteFile(strfilesource); }
else {
fso.MoveFile(strfilesource,strfiledup); }
}
else {
fso.MoveFile(strfilesource,strfiledest); }
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058281#4058281
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058281
18Â years, 10Â months
[JBoss Seam] - Re: Handling database exceptions
by shakenbrain
Understood. Gavin, thanks for your response.
Getting back to validating then, it appears that using a @Validator class causes the session to go invalid when it throws a ValidatorException, but only on the whole form submit (it works if you do a partial form submit using ajax4jsf on just that one field, using <a:support>). Here's a validator class that does nothing but throw the exception:
@Validator
| @Name("prefixValidator")
| public class PrefixValidator extends BaseValidator {
|
| @In
| EntityManager entityManager;
|
| // @Transactional
| public void validate(FacesContext context, UIComponent component, Object value)
| throws ValidatorException {
|
| throw new ValidatorException(makeMessage("Prefix is being used already."));
|
| }
| }
and the relevent xhtml:
<s:decorate id="prefixDecorator" template="/decorateField.xhtml">
| <ui:define name="label">Prefix</ui:define>
| <h:inputText id="prefix" size="4" value="#{selectedOrganization.prefix}" required="true" disabled="#{!organizationAdmin.new}">
| <f:validator validatorId="prefixValidator"/>
| </h:inputText>
| </s:decorate>
That should work right? Is this a bug? I haven't tried this in 2.0 Beta yet, I'll try to do that today.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058280#4058280
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058280
18Â years, 10Â months
[JBoss jBPM] - Re: process upload with tomahawk
by ricardomarques
yes it does, i forgot to paste the definition:
|
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process-definition
| xmlns="urn:jbpm.org:jpdl-3.1" name="holiday-request">
| <swimlane name="initiator">
| <assignment expression="user(grover)"></assignment>
| </swimlane>
| <start-state name="enter request">
| <task name="request entry" swimlane="initiator">
| <controller>
| <variable name="start date" access="read,write,required"></variable>
| <variable name="duration" access="read,write,required"></variable>
| </controller>
| </task>
| <transition name="" to="evaluate request"></transition>
| </start-state>
| <end-state name="end"></end-state>
| <task-node name="evaluate request">
| <task name="entry evaluation" swimlane="initiator">
| <controller>
| <variable name="start date" access="read"></variable>
| <variable name="duration" access="read"></variable>
| <variable name="info" access="read"></variable>
| <variable name="decision"></variable>
| </controller>
| </task>
| <transition name="More info needed" to="give addition info"></transition>
| <transition name="approve/disapprove" to="end"></transition>
| </task-node>
| <task-node name="give addition info">
| <task name="additional info entry" swimlane="initiator">
| <controller>
| <variable name="start date" access="read"></variable>
| <variable name="duration" access="read"></variable>
| <variable name="info"></variable>
| </controller>
| </task>
| <transition name="" to="evaluate request"></transition>
| </task-node>
| </process-definition>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4058270#4058270
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4058270
18Â years, 10Â months