Execute task in background
Hello,
I want to load up to nine panels in a TilePane. For each pane I have to run frist an computation of the content (about 300ms) and second have to build the Panel (about 500ms). What I want is, that there are nine ProgressIndicators which exchanges with every panel after its computation.
I tried it with the Platform.runlater command as well as with a service class. The result was always the same. The ProgressIndicator are shown, but not animated. After seconds there all all panels at once.
Is there a possibility, that the Indicators are animated the hole time and that I can exchange them one after another?
Best Regards,
Tobias Wilker
Thanks for the help. This is how I solved the problem:
import java.util.Random;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Service;
import javafx.concurrent.Task;
import javafx.concurrent.Worker;
import javafx.concurrent.Worker.State;
import javafx.geometry.Insets;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressBar;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.TilePane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
public class Minimal extends Application {
private TilePane loadPane;
private ProgressIndicator[] indicators = new ProgressIndicator[9];
private Label loading[] = new Label[9];
private Color[] colors = {Color.BLACK,Color.BLUE,Color.CRIMSON,Color.DARKCYAN,Color.FORESTGREEN,Color.GOLD,Color.HOTPINK,Color.INDIGO,Color.KHAKI};
private int counter = 0;
@Override
public void start(Stage primaryStage) throws Exception {
//creating Layout
final Group root = new Group();
Scene scene = new Scene(root, 400, 400);
primaryStage.setScene(scene);
primaryStage.setResizable(false);
StackPane waitingPane = new StackPane();
final ProgressBar progress = new ProgressBar();
Label load = new Label("loading things...");
progress.setTranslateY(-25);
load.setTranslateY(25);
waitingPane.getChildren().addAll(new Rectangle(400,400,Color.WHITE),load,progress);
root.getChildren().add(waitingPane);
//Task for computing the Panels:
Task<Void> task = new Task<Void>() {
@Override
protected Void call() throws Exception {
for (int i = 0; i < 20; i++) {
try {
Thread.sleep(new Random().nextInt(1000));
} catch (InterruptedException ex) {
ex.printStackTrace();
final double prog = i*0.05;
Platform.runLater(new Runnable() {
public void run() {
progress.setProgress(prog);
return null;
//stateProperty for Task:
task.stateProperty().addListener(new ChangeListener<Worker.State>() {
@Override
public void changed(ObservableValue<? extends State> observable,
State oldValue, Worker.State newState) {
if(newState==Worker.State.SUCCEEDED){
loadPanels(root);
//start Task
new Thread(task).start();
primaryStage.show();
private void loadPanels(Group root) {
//change to loadPanel:
root.getChildren().set(0,createLoadPane());
//Service:
final Service<Rectangle> RecBuilder = new Service<Rectangle>() {
@Override protected Task<Rectangle> createTask() {
return new Task<Rectangle>() {
@Override protected Rectangle call() throws InterruptedException {
updateMessage("loading rectangle . . .");
updateProgress(0, 10);
for (int i = 0; i < 10; i++) {
Thread.sleep(100);
updateMessage("Finish!");
return new Rectangle((380)/3,(380)/3,colors[counter]);
//StateListener
RecBuilder.stateProperty().addListener(new ChangeListener<Worker.State>() {
@Override public void changed(ObservableValue<? extends Worker.State> observableValue,
Worker.State oldState, Worker.State newState) {
switch (newState) {
case SCHEDULED:
break;
case READY:
case RUNNING:
break;
case SUCCEEDED:
Rectangle rec = RecBuilder.valueProperty().getValue();
indicators[counter].progressProperty().unbind();
loading[counter].textProperty().unbind();
loadPane.getChildren().set(counter, rec);
if(counter<8){
counter++;
nextPane(RecBuilder);
break;
case CANCELLED:
case FAILED:
loading[counter].textProperty().unbind();
loading[counter].setText("Failed!");
if(counter<8){
counter++;
nextPane(RecBuilder);
break;
//begin PanelBuilding:
nextPane(RecBuilder);
private void nextPane(Service<Rectangle> recBuilder) {
loading[counter].textProperty().bind(recBuilder.messageProperty());
indicators[counter].visibleProperty().bind(recBuilder.progressProperty().isNotEqualTo(new SimpleDoubleProperty(ProgressBar.INDETERMINATE_PROGRESS)));
recBuilder.restart();
private Node createLoadPane() {
loadPane = new TilePane(5,5);
loadPane.setPrefColumns(3);
loadPane.setPadding(new Insets(5));
for(int i=0;i<9;i++){
StackPane waitingPane = new StackPane();
Rectangle background = new Rectangle((380)/3, (380)/3, Color.WHITE);
indicators[i] = new ProgressIndicator();
indicators.setPrefSize(50, 50);
indicators[i].setMaxSize(50, 50);
indicators[i].setTranslateY(-25);
indicators[i].setTranslateX(-10);
loading[i] = new Label();
loading[i].setTranslateY(25);
waitingPane.getChildren().addAll(background,indicators[i],loading[i]);
loadPane.getChildren().add(waitingPane);
return loadPane;
public static void main(String[] args) {
launch(args);
Similar Messages
-
UCBATCH00 and UCBATCH01 execute task
Hi All,
I have to upload my consolidation data in SEM BCS using a task. WE have two program UCBATCH00 to execute a task. When i use this program in foreground then it gives me statistical report about uploaded data. When ever i execute the same program in background then it does not create any report in spool.
I have to schedule this program in background and need a statistical report in spool for do the analysis later on.
There is another program UCBATCH01 (Schedule and Execute Task). Even though this program does not create any report in spool when i schedule in background.
I need to execute my task in background and need a statistical report in spool to analyse later on.
Thanks in advance.
Regards
PraffHi Sayed,
My apologies. I have a similar query on the Bangladesh slabwise query you posted earlier. If you could, please kindly share with me how do you configure for Bangladesh WHT requirements.
If you could, please reply to the message that you posted earlier on the query for Bangladesh WHT with your solution.
Hope to hear from you soon as I am also encountering a similar requirement from my client for Bangladesh too.
Thanks!
Cheers,
Orange -
Hello experts,
I have a workflow which is stopping at the first task with message 'READY (No agent). In transaction SWI1 the status is 'W' requiring me to execute it. I want the workflow to execute automatically so I want to change the task to BACKGROUND so that WF-BATCH process will execute it. However when I call up the task in PFTC in change mode the checkbox for background is greyed out. If I delete the task and recreate it again it will require me to re-build my workflow so is there a way to change a task to background without having to delete it and re-create it again.
Thanks
David Dittmer
AccentureHi,
As the workitem type is 'W' that means its a dialog workitem hence you can not change change the task to BACKGROUND. Checkbox for background is always be greyed out.
My suggestions.........
1. Place the dialog step with new background activity step. For this you need to change the workflow design.
2. Create a background job which will run periodically which will complete all the dialog workitem by the FM SAP_WAPI_WORKITEM_COMPLETE
Thanks and regards,
SNJY -
Front-end functions cannot be executed in the background in SM37
Hi ,
I have developed a BDC program for Tcode HRUSER . The program is working fine in Frontend but when Executed in Background through SM37 gives a error -:
"Front-end functions cannot be executed in the background".
I am not using any function like GUI_DOWNLOAD or anything like that .
Thanks
Nikhil Arya.Hi ,
No , the program is not taking any inputs from the user .
when i am executing the program in background mode it is just showing the messages at the end which i am writing in the program for eg:
"creating a user for employee 2306328".
So , only the list of messages comes at the end .
Thanks
Nikhil Arya. -
Restrict 'Executing report in background' from selection screen
I want user to not to select option for executing report in background from Selection Screen of the program.
i.e. 'Execute Program in Background' option in 1st menu bar tab should either be disabled OR if user clicks on it then he should get error message on selection screen itself.
Thanks,
FalguniHi Falguni,
Write the code based on function code SJOB in the event AT SELECTION-SCREEN. Write the following code :
AT SELECTION-SCREEN
CASE SY-UCOMM.
WHEN 'SJOB'.
MESSAGE E000 WITH 'You cannot schedule background job'.
ENDCASE.
Thanks & Regards,
Faheem. -
Execute listcube in background - where is the file stored on app server
Hi,
I want to execute listcube in background.
to execute in background, the only output option available is Store in file (appl server).
My question is where is this file stored.
there is no information in the job log nor is there any spool.
Also, can I determine myself where is this output file written.I have a couple of questions that could lead to an answer to your question...
Does your BW environment have one or more application servers, in addition to the Database Central Instance (DBCI)? If so, do you use logon groups for SAP Logon so that the logon loads are balanced?
I'm asking these questions because if you have a multiple application server environment and logon balancing, you may not be logging onto the same server every time that you're executing LISTCUBE and it will save to the directory path of the server you're logged onto. -
Execute Task works in one area but not the other
I have two Execute SQL Tasks. Each executes the same stored procedure from the SQL Statement property with a different parameter and they insert into the same table. One is at the end of the package and only runs if a Rollback
is done and it works fine. The other runs when a script is performed and returns Failure. When I run the other package and the Script fails the Execute SQL Task gets a green check mark but the table is not updated.
I've messed with the properties and still no luck.
I can right-click on the SQL Task choose "Execute Task" and it works.
I've run out of ideas.uspGenerateTasksForFailedSSISPackage is a stored procedure that inserts into a table.
ALTER PROCEDURE [dbo].[uspGenerateTasksForForFailedSSISPackage]
@strTaskDescription varchar(max) = NULL
WITH RECOMPILE
AS
BEGIN
SET NOCOUNT ON;
Declare
@dtEnteredDateAndDueDate date = GetDate(),
@intTodoCategoryCode int = 13,
@strEnteredBy varchar(20) = 'AUTO'
INSERT INTO ToDos (UserID, EnteredBy, EnteredDate, DueDate, Description, CategoryCode)
Values (@strEnteredBy, @dtEnteredDateAndDueDate, @dtEnteredDateAndDueDate, @strTaskDescription, @intTodoCategoryCode) -
hi
we have one requirement for execute report in background
we want to run the report ME5A for a large date range and at plant level.
Due to this, transaction data selected is large and so reportis taking very long time when executed in foreground.
so requirement is
execute report in background (i know possible in SAP)
download the report output on desktop automatically
can you pl suggest how to do this without customisation
regards
saraHi Sara,
Go to ME5A then enter the required field then go to Programme and then select the option execute in background -
Problem executing task in consolidation monitor
Hello
I have a small issue i get the following error message when i try to test executing a task in cons monitor for load from data stream
Task 001001 cannot be executed in period 001
Message no. UCS0150
Diagnosis
No method with a period category containing period 001 is assigned to task 001001 in version 111 for the time period 2008/001.
System Response
Task cannot be executed in period 001.
Procedure
If you still want to execute task 001001 in period 001, you need to use period categories that contain period 001 in the customizing settings of the task when you assign a method.
Here I am trying to collect data using Load from Data Stream, I have defined the method and I am able to test the same in consolidation workbench
But the same does not work in consolidation monitor
why??
Following are defined :
Method for Load from Data stream
Method
Task
In consolidatin monitor I have
Hierarchy
task group and task.
Regards
sameerHi Sameer K
Now I got the same error message, when executing data collection task in cons monitor.
I did as per inputs provided by you in this thread. But it was not work.
Let us explain what occur in my end is i changes period category in data collection task and then save it. After than I close the session and reopen, what ever i changes earlier was not appearing in my workbench in Data collection task.
Configuration in Data Collection task was:
Cons Freq: Monthly
Period Category: All method follows same method. In this we maintain 1 to 12 periods
Assign method: Depends on Company (I configred data collection method for each company)
Pls provide inputs to resolve
Madhu -
Error Task Sequence Manager failed to execute task sequence. Code 0x80004005 TSManager
Dear All,
I need your Help, as I am getting below mention error in deployment of OS through MDT 2013.
Expand a string: WinPEandFullOS TSManager 6/5/2014 11:40:50 AM 1464 (0x05B8)
Executing command line: cscript.exe "%SCRIPTROOT%\LTIApply.wsf" TSManager 6/5/2014 11:40:50 AM 1464 (0x05B8)
Process completed with exit code 5627 TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
!--------------------------------------------------------------------------------------------! TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Failed to run the action: Install Operating System.
Unknown error (Error: 000015FB; Source: Unknown) TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Sending status message . . . TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Executing in non SMS standalone mode. Ignoring send a task execution status message request TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Set a global environment variable _SMSTSLastActionRetCode=5627 TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Set a global environment variable _SMSTSLastActionSucceeded=false TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Clear local default environment TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Let the parent group (Install) decides whether to continue execution TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
The execution of the group (Install) has failed and the execution has been aborted. An action failed.
Operation aborted (Error: 80004004; Source: Windows) TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Failed to run the last action: Install Operating System. Execution of task sequence failed.
Unknown error (Error: 000015FB; Source: Unknown) TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Sending status message . . . TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Executing in non SMS standalone mode. Ignoring send a task execution status message request TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Execution::enExecutionFail != m_eExecutionResult, HRESULT=80004005 (e:\nts_sms_fre\sms\client\tasksequence\tsmanager\tsmanager.cpp,767) TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Task Sequence Engine failed! Code: enExecutionFail TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
**************************************************************************** TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Task sequence execution failed with error code 80004005 TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Cleaning Up. Removing Authenticator TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Cleaning up task sequence folder TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
DeleteFileW(sVolumeIDFile.c_str()), HRESULT=80070002 (e:\nts_sms_fre\sms\framework\tscore\resolvesource.cpp,508) TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
DeleteFileW(sVolumeIDFile.c_str()), HRESULT=80070002 (e:\nts_sms_fre\sms\framework\tscore\resolvesource.cpp,508) TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Successfully unregistered Task Sequencing Environment COM Interface. TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Command line for extension .exe is "%1" %* TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Set command line: "X:\Deploy\Tools\X86\TsProgressUI.exe" /Unregister TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Executing command line: "X:\Deploy\Tools\X86\TsProgressUI.exe" /Unregister TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
==========[ TsProgressUI started in process 320 ]========== TsProgressUI 6/5/2014 11:51:18 AM 552 (0x0228)
Command line: "X:\Deploy\Tools\X86\TsProgressUI.exe" /Unregister TsProgressUI 6/5/2014 11:51:18 AM 552 (0x0228)
Unregistering COM classes TsProgressUI 6/5/2014 11:51:18 AM 552 (0x0228)
Unregistering class objects TsProgressUI 6/5/2014 11:51:18 AM 552 (0x0228)
Shutdown complete. TsProgressUI 6/5/2014 11:51:18 AM 552 (0x0228)
Process completed with exit code 0 TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Successfully unregistered TS Progress UI. TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
g_TSManager.Run(), HRESULT=80004005 (e:\nts_sms_fre\sms\client\tasksequence\tsmanager\tsmanager.cpp,657) TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Error Task Sequence Manager failed to execute task sequence. Code 0x80004005 TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Sending error status message TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
In non SMS staqndalone mode.Ignoring SendStatusMessage request TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Finalizing logging from process 1456 TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Finalizing logs to root of first available drive TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Successfully finalized logs to C:\SMSTSLog TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Cleaning up task sequencing logging configuration. TSManager 6/5/2014 11:51:18 AM 1464 (0x05B8)
Deployment is going failed.
Regards
SachiNote:Only mass storage device drivers and network adapter device drivers should be added to boot images because other types of
drivers are not needed and will increase the size of the boot image:
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place. -
Issue with How Do I Run an Executable in the Background ?
Hi,
I am trying to run a LabVIEw executable in the background, but none of the methods described in the discussion forum and on ni.com seems to be working. I am using LV 2011 on a Win 7 64-bit machine in case this matters.
I tried the method described in "How Do I Run an Executable in the Background as a Start-Up Application?" (http://digital.ni.com/public.nsf/websearch/4A8B626B55B96C248625796000569FA9?opendocument&Submitted&&... but I still see a fragment of a window at the bottom near the start-button (Exhibit 1). Exhibit 2 shows that it only consists of the title bar. (I have customized the window appearance as described, and added the two items
HideRootWindow=True
UseTaskBar=FALSE
to the *.ini file.)
I also tried disabling all the other items in the Customize Window Appearance menu with the same result.
Then I tried the method described in "Running a LabVIEW Executable as a Background Process" (http://digital.ni.com/public.nsf/allkb/EFEAE56A94A007D586256EF3006E258B) adding the FP.Open method to the VI and setting the state to hidden. I got the same result (Exhibit 1).
Is there anything I need to do in addition or different for my windows version? I appreciate your help. Thank you.
Solved!
Go to Solution.
Attachments:
LabVIEW Executable.zip 4058 KB(I have customized the window appearance as described, and added the two items
HideRootWindow=True
UseTaskBar=FALSE
to the *.ini file.)
No you did not
They need to go in the exe's ini so the exe sees them
Jeff -
Errors when attempt to execute task 'Approve and Deploy to Product'
Hello all,
I updated the pricelists from BCC, an error occurred when I attempted to execute task 'Approve and Deploy to Production', it shows ‘atg.epub.workflow.process.WorkflowProcessResources->invalidTargetName : There is no target with the given name Production.’
Here is the ATGPublishing server error log:
atg.process.action.ActionException: atg.epub.workflow.process.WorkflowProcessResources->invalidTargetName : There is no target with the given name Production.
Can anyone tell me how to resolve this error. Thank you in advance.Check this in your production BCC component browser.
/dyn/admin/nucleus/atg/epub/workflow/process/WorkflowProcessManager/?action=seedefinition&process=/Commerce/editCommerceAssets.wdl
Search for approveAndDeployProject, you will find the target. Make sure its correct and same String value is used in BCC when creating sites.
And make
atg/epub/Configuration.properties
queryWorkflowTargetByID=false
Otherwise send me the contents from dyn/admin
Peace
Shaik -
Difference between exec. target and executing server in background jobs
Dear experts,
Please let me know
Difference between exec. target and executing server in background jobsDear Joe,
Sorry for this
I am closing this threaf now -
Execute calc in background not working
Essbase version 9.3.1 running on Red Hat Linux. When I'm in EAS and check the "Execute in the background" box I get the message if what launched in the background with a Process ID but no calc kicks off, nothing in the app log file, nothing shows up when I look at background processes, no session when I look at server. The calc runs fine if I don't select to run in the background.
Anyone else run across this or am I missing something?I had the identical issue and received the below fix from Oracle Support, which worked. I thought I'd put the fix up here, since the forums were my first stop when I had the problem.
1. There will be a file called Workstatus.xml in the EAS server
2. Search for this file
3. Rename the file or cut and paste this file to a different location.Restart the EAS server
4. Run the calc in background it will work fine
And it did! This was on Windows Server 2003, Essbase 9.3.1.2.
Thanks,
-Another Rob -
Need to Execute a Dialog Task in Background
Dear All,
We have an requirement , where we need to execute a dialog workitem in the background. I need the techinicalities / features possible or not.
We are having the workitem Id , I need to execute and get the options available with that first ( Assuming Workitem is User decision ). And in the next stage I will be passing the options like 0001 or 0002 ( approve / reject ) to another FM where the workitem gets completed and proceeds further.
I need to perform the FM - SAP_WAPI_EXECUTE_WORKITEM in the back ground in two steps.
or Is there any FM which will update the user desicion with given options in background and executes a workitem , as if an SAP user is executing.
regards,
sabari prabhu.Prabhu,
If you want to complete the workitem and if you process is still in workflow. Better way is to use Process control to complete the workitem & you can also use Condition step to validate the outcome or any option.
If it is outside of the workflow which need to be completed, you can use "SAP_WAPI_EXECUTE_WORKITEM"
If possible, can you elaborate your requirement.
Thanks,
Sudhir.
Maybe you are looking for
-
Message states that Camera Raw is not enabled after transferring data to a new MacbookPro
Using photoshop and Bridge CS6. When I attempt to open a photo in Camera raw I receive this message Camera Raw is not enabled. "Camera raw requires that a qualifying product has been launched at least once to enable this feature.
-
Dynamic watermarking to document
Hi, I want to water mark the document when i download. I configure IBR server(http://docs.oracle.com/cd/E17904_01/doc.1111/e14495/configibr.htm) i followed all the step as per the link. I am using RIDC to communicate with UCM. I used GET_File command
-
Prerequiste checker for Secondary site 2012 Sp1
Hello All, We want to install SCCM 2012 SP1 Secondary site from SCCM Primary console. We found out that we can run PreRequiste checker command from primary site server like below: ◦prereqchk.exe /SEC /Ssbport 4022 /SourceDir <Source Folder Path> I ha
-
Nokia Lumia 520: Lumia Black Update
Hello, I have a Nokia Lumia 520.2 (GoPhone) I am eagerly awaiting the black update as I have heard in may include support for my bluetooth keyboard I would very much like to use. I am still showing "Lumia Amber" and I am wondering if I am getting gli
-
hi All, I am writing a BDC for removal of outbound delivery from manifest as **--Record the BDC for deleting deliveries from Manifest REFRESH bdcdata. CLEAR bdcdata. REFRESH messtab. PERFORM bdc_dynpro USING