Search Results

Search found 1594 results on 64 pages for 'initialization'.

Page 3/64 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Firefox extension js object initialization

    - by Michael
    Note: this is about Firefox extension, not a js general question. In Firefox extension project I need my javascript object to be initialized just once per Firefox window. Otherwise each time I open my window a new timers will be engaged, new properties will be used, so everything will start from scratch. hope example below will demystify my question :) var StupidExtension { statusBarValue: "Not Initialized Yet", startup: function () { ... // Show statusBarValue in Status Bar Panel }, initTimerToRetrieveStatusBarValueFromNetwork: function () { ... } } so each time you hit Ctrl+N a new window you will see "Not Initialized Yet" and then new timer will be fired, so after some time it retrieve data from network you will see value also on second window and so on. Ideally would be to have just a single timer function running and updating all status bar panels in all Firefox windows. Of course I can do some caching, like saving the value in prefs or some other storage, then show it from there. But I feel like this is artificial. So the question will be is there "native" technique of making static some parts of the object among all Firefox window instances?

    Read the article

  • Custom class object in Initialization list

    - by Michael
    I have a class Bar: class Bar { public: Bar(void); ~Bar(void); }; And a class Foo that gets a reference to Bar object as a constructor parameter and needs to save it in a private member bar_ : class Foo { private: Bar& bar_; public: Foo(Bar& bar) : bar_(bar) {} ~Foo(void) {} }; This doesn't compile : overloaded member function not found in 'Parser' missing type specifier - int assumed. Note: C++ does not support default-int Now i suspect couple of things that i need to assure, the second error is for Bar& bar_; declaration in Foo. Do i need to use an explicit constructor when declaring bar_ ? I am interested in learning how the compiler works regarding this matter, so a detailed explanation would be highly appreciated. Thanks.

    Read the article

  • Automatic initialization routine in C++ library?

    - by Robert Mason
    If i have a header file foo.h and a source file foo.cpp, and foo.cpp contains something along the lines of: #ifdef WIN32 class asdf { asdf() { startup_code(); } ~asdf() { cleanup_code(); } }; asdf __STARTUP_HANDLE__ #else //unix does not require startup or cleanup code in this case #endif but foo.h does not define class asdf, say i have an application bar.cpp: #include "foo.h" //link in foo.lib, foo.dll, foo.so, etc int main() { //do stuff return 0; } If bar.cpp is compiled on a WIN32 platform, will the asdf() and ~asdf() be called at the appropriate times (before main() and at program exit, respectively) even though class asdf is not defined in foo.h, but is linked in through foo.cpp?

    Read the article

  • static initialization confusion

    - by Happy Mittal
    I am getting very confused in some concepts in c++. For ex: I have following two files //file1.cpp class test { static int s; public: test(){s++;} }; static test t; int test::s=5; //file2.cpp #include<iostream> using namespace std; class test { static int s; public: test(){s++;} static int get() { return s; } }; static test t; int main() { cout<<test::get()<<endl; } Now My question is : 1. How two files link successfully even if they have different class definitions? 2. Are the static member s of two classes related because I get output as 7. Please explain this concept of statics.

    Read the article

  • static initialization order fiasco

    - by Happy Mittal
    I was reading about SIOF from a book and it gave an example : //file1.cpp extern int y; int x=y+1; //file2.cpp extern int x; y=x+1; Now My question is : In above code..will following things happen ? 1. while compiling file1.cpp, compiler leaves y as it is i.e doesn't allocate storage for it. 2. compiler allocates storage for x, but doesn't initialize it. 3. While compiling file2.cpp, compiler leaves x as it is i.e doesn't allocate storage for it. 4. compiler allocates storage for y, but doesn't initialize it. 5. While linking file1.o and file2.o, now let file2.o is initialized first, so now: Does x gets initial value of 0? or doesn't get initialized?

    Read the article

  • gluNewQuadric() before opengl's initialization

    - by Schrödinger's cat
    Hello, I'm working on a c++ code that uses SDL/opengl. Is this possible to create a pointer to a quadric with 'gluNewQuadric()' before having initialized opengl with 'SDL_SetVideoMode'? The idea is to create a class with a (pointer to a) quadric class member that has to be instantiate before the 'SDL_SetVideoMode' call. This pointer is initialized in the class' constructor with a 'gluNewQuadric()' call.

    Read the article

  • Use IIS Application Initialization for keeping ASP.NET Apps alive

    - by Rick Strahl
    I've been working quite a bit with Windows Services in the recent months, and well, it turns out that Windows Services are quite a bear to debug, deploy, update and maintain. The process of getting services set up,  debugged and updated is a major chore that has to be extensively documented and or automated specifically. On most projects when a service is built, people end up scrambling for the right 'process' to use for administration. Web app deployment and maintenance on the other hand are common and well understood today, as we are constantly dealing with Web apps. There's plenty of infrastructure and tooling built into Web Tools like Visual Studio to facilitate the process. By comparison Windows Services or anything self-hosted for that matter seems convoluted.In fact, in a recent blog post I mentioned that on a recent project I'd been using self-hosting for SignalR inside of a Windows service, because the application is in fact a 'service' that also needs to send out lots of messages via SignalR. But the reality is that it could just as well be an IIS application with a service component that runs in the background. Either way you look at it, it's either a Windows Service with a built in Web Server, or an IIS application running a Service application, neither of which follows the standard Service or Web App template.Personally I much prefer Web applications. Running inside of IIS I get all the benefits of the IIS platform including service lifetime management (crash and restart), controlled shutdowns, the whole security infrastructure including easy certificate support, hot-swapping of code and the the ability to publish directly to IIS from within Visual Studio with ease.Because of these benefits we set out to move from the self hosted service into an ASP.NET Web app instead.The Missing Link for ASP.NET as a Service: Auto-LoadingI've had moments in the past where I wanted to run a 'service like' application in ASP.NET because when you think about it, it's so much easier to control a Web application remotely. Services are locked into start/stop operations, but if you host inside of a Web app you can write your own ticket and control it from anywhere. In fact nearly 10 years ago I built a background scheduling application that ran inside of ASP.NET and it worked great and it's still running doing its job today.The tricky part for running an app as a service inside of IIS then and now, is how to get IIS and ASP.NET launched so your 'service' stays alive even after an Application Pool reset. 7 years ago I faked it by using a web monitor (my own West Wind Web Monitor app) I was running anyway to monitor my various web sites for uptime, and having the monitor ping my 'service' every 20 seconds to effectively keep ASP.NET alive or fire it back up after a reload. I used a simple scheduler class that also includes some logic for 'self-reloading'. Hacky for sure, but it worked reliably.Luckily today it's much easier and more integrated to get IIS to launch ASP.NET as soon as an Application Pool is started by using the Application Initialization Module. The Application Initialization Module basically allows you to turn on Preloading on the Application Pool and the Site/IIS App, which essentially fires a request through the IIS pipeline as soon as the Application Pool has been launched. This means that effectively your ASP.NET app becomes active immediately, Application_Start is fired making sure your app stays up and running at all times. All the other features like Application Pool recycling and auto-shutdown after idle time still work, but IIS will then always immediately re-launch the application.Getting started with Application InitializationAs of IIS 8 Application Initialization is part of the IIS feature set. For IIS 7 and 7.5 there's a separate download available via Web Platform Installer. Using IIS 8 Application Initialization is an optional install component in Windows or the Windows Server Role Manager: This is an optional component so make sure you explicitly select it.IIS Configuration for Application InitializationInitialization needs to be applied on the Application Pool as well as the IIS Application level. As of IIS 8 these settings can be made through the IIS Administration console.Start with the Application Pool:Here you need to set both the Start Automatically which is always set, and the StartMode which should be set to AlwaysRunning. Both have to be set - the Start Automatically flag is set true by default and controls the starting of the application pool itself while Always Running flag is required in order to launch the application. Without the latter flag set the site settings have no effect.Now on the Site/Application level you can specify whether the site should pre load: Set the Preload Enabled flag to true.At this point ASP.NET apps should auto-load. This is all that's needed to pre-load the site if all you want is to get your site launched automatically.If you want a little more control over the load process you can add a few more settings to your web.config file that allow you to show a static page while the App is starting up. This can be useful if startup is really slow, so rather than displaying blank screen while the user is fiddling their thumbs you can display a static HTML page instead: <system.webServer> <applicationInitialization remapManagedRequestsTo="Startup.htm" skipManagedModules="true"> <add initializationPage="ping.ashx" /> </applicationInitialization> </system.webServer>This allows you to specify a page to execute in a dry run. IIS basically fakes request and pushes it directly into the IIS pipeline without hitting the network. You specify a page and IIS will fake a request to that page in this case ping.ashx which just returns a simple OK string - ie. a fast pipeline request. This request is run immediately after Application Pool restart, and while this request is running and your app is warming up, IIS can display an alternate static page - Startup.htm above. So instead of showing users an empty loading page when clicking a link on your site you can optionally show some sort of static status page that says, "we'll be right back".  I'm not sure if that's such a brilliant idea since this can be pretty disruptive in some cases. Personally I think I prefer letting people wait, but at least get the response they were supposed to get back rather than a random page. But it's there if you need it.Note that the web.config stuff is optional. If you don't provide it IIS hits the default site link (/) and even if there's no matching request at the end of that request it'll still fire the request through the IIS pipeline. Ideally though you want to make sure that an ASP.NET endpoint is hit either with your default page, or by specify the initializationPage to ensure ASP.NET actually gets hit since it's possible for IIS fire unmanaged requests only for static pages (depending how your pipeline is configured).What about AppDomain Restarts?In addition to full Worker Process recycles at the IIS level, ASP.NET also has to deal with AppDomain shutdowns which can occur for a variety of reasons:Files are updated in the BIN folderWeb Deploy to your siteweb.config is changedHard application crashThese operations don't cause the worker process to restart, but they do cause ASP.NET to unload the current AppDomain and start up a new one. Because the features above only apply to Application Pool restarts, AppDomain restarts could also cause your 'ASP.NET service' to stop processing in the background.In order to keep the app running on AppDomain recycles, you can resort to a simple ping in the Application_End event:protected void Application_End() { var client = new WebClient(); var url = App.AdminConfiguration.MonitorHostUrl + "ping.aspx"; client.DownloadString(url); Trace.WriteLine("Application Shut Down Ping: " + url); }which fires any ASP.NET url to the current site at the very end of the pipeline shutdown which in turn ensures that the site immediately starts back up.Manual Configuration in ApplicationHost.configThe above UI corresponds to the following ApplicationHost.config settings. If you're using IIS 7, there's no UI for these flags so you'll have to manually edit them.When you install the Application Initialization component into IIS it should auto-configure the module into ApplicationHost.config. Unfortunately for me, with Mr. Murphy in his best form for me, the module registration did not occur and I had to manually add it.<globalModules> <add name="ApplicationInitializationModule" image="%windir%\System32\inetsrv\warmup.dll" /> </globalModules>Most likely you won't need ever need to add this, but if things are not working it's worth to check if the module is actually registered.Next you need to configure the ApplicationPool and the Web site. The following are the two relevant entries in ApplicationHost.config.<system.applicationHost> <applicationPools> <add name="West Wind West Wind Web Connection" autoStart="true" startMode="AlwaysRunning" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated"> <processModel identityType="LocalSystem" setProfileEnvironment="true" /> </add> </applicationPools> <sites> <site name="Default Web Site" id="1"> <application path="/MPress.Workflow.WebQueueMessageManager" applicationPool="West Wind West Wind Web Connection" preloadEnabled="true"> <virtualDirectory path="/" physicalPath="C:\Clients\…" /> </application> </site> </sites> </system.applicationHost>On the Application Pool make sure to set the autoStart and startMode flags to true and AlwaysRunning respectively. On the site make sure to set the preloadEnabled flag to true.And that's all you should need. You can still set the web.config settings described above as well.ASP.NET as a Service?In the particular application I'm working on currently, we have a queue manager that runs as standalone service that polls a database queue and picks out jobs and processes them on several threads. The service can spin up any number of threads and keep these threads alive in the background while IIS is running doing its own thing. These threads are newly created threads, so they sit completely outside of the IIS thread pool. In order for this service to work all it needs is a long running reference that keeps it alive for the life time of the application.In this particular app there are two components that run in the background on their own threads: A scheduler that runs various scheduled tasks and handles things like picking up emails to send out outside of IIS's scope and the QueueManager. Here's what this looks like in global.asax:public class Global : System.Web.HttpApplication { private static ApplicationScheduler scheduler; private static ServiceLauncher launcher; protected void Application_Start(object sender, EventArgs e) { // Pings the service and ensures it stays alive scheduler = new ApplicationScheduler() { CheckFrequency = 600000 }; scheduler.Start(); launcher = new ServiceLauncher(); launcher.Start(); // register so shutdown is controlled HostingEnvironment.RegisterObject(launcher); }}By keeping these objects around as static instances that are set only once on startup, they survive the lifetime of the application. The code in these classes is essentially unchanged from the Windows Service code except that I could remove the various overrides required for the Windows Service interface (OnStart,OnStop,OnResume etc.). Otherwise the behavior and operation is very similar.In this application ASP.NET serves two purposes: It acts as the host for SignalR and provides the administration interface which allows remote management of the 'service'. I can start and stop the service remotely by shutting down the ApplicationScheduler very easily. I can also very easily feed stats from the queue out directly via a couple of Web requests or (as we do now) through the SignalR service.Registering a Background Object with ASP.NETNotice also the use of the HostingEnvironment.RegisterObject(). This function registers an object with ASP.NET to let it know that it's a background task that should be notified if the AppDomain shuts down. RegisterObject() requires an interface with a Stop() method that's fired and allows your code to respond to a shutdown request. Here's what the IRegisteredObject::Stop() method looks like on the launcher:public void Stop(bool immediate = false) { LogManager.Current.LogInfo("QueueManager Controller Stopped."); Controller.StopProcessing(); Controller.Dispose(); Thread.Sleep(1500); // give background threads some time HostingEnvironment.UnregisterObject(this); }Implementing IRegisterObject should help with reliability on AppDomain shutdowns. Thanks to Justin Van Patten for pointing this out to me on Twitter.RegisterObject() is not required but I would highly recommend implementing it on whatever object controls your background processing to all clean shutdowns when the AppDomain shuts down.Testing it outI'm still in the testing phase with this particular service to see if there are any side effects. But so far it doesn't look like it. With about 50 lines of code I was able to replace the Windows service startup to Web start up - everything else just worked as is. An honorable mention goes to SignalR 2.0's oWin hosting, because with the new oWin based hosting no code changes at all were required, merely a couple of configuration file settings and an assembly directive needed, to point at the SignalR startup class. Sweet!It also seems like SignalR is noticeably faster running inside of IIS compared to self-host. Startup feels faster because of the preload.Starting and Stopping the 'Service'Because the application is running as a Web Server, it's easy to have a Web interface for starting and stopping the services running inside of the service. For our queue manager the SignalR service and front monitoring app has a play and stop button for toggling the queue.If you want more administrative control and have it work more like a Windows Service you can also stop the application pool explicitly from the command line which would be equivalent to stopping and restarting a service.To start and stop from the command line you can use the IIS appCmd tool. To stop:> %windir%\system32\inetsrv\appcmd stop apppool /apppool.name:"Weblog"and to start> %windir%\system32\inetsrv\appcmd start apppool /apppool.name:"Weblog"Note that when you explicitly force the AppPool to stop running either in the UI (on the ApplicationPools page use Start/Stop) or via command line tools, the application pool will not auto-restart immediately. You have to manually start it back up.What's not to like?There are certainly a lot of benefits to running a background service in IIS, but… ASP.NET applications do have more overhead in terms of memory footprint and startup time is a little slower, but generally for server applications this is not a big deal. If the application is stable the service should fire up and stay running indefinitely. A lot of times this kind of service interface can simply be attached to an existing Web application, or if scalability requires be offloaded to its own Web server.Easier to work withBut the ultimate benefit here is that it's much easier to work with a Web app as opposed to a service. While developing I can simply turn off the auto-launch features and launch the service on demand through IIS simply by hitting a page on the site. If I want to shut down an IISRESET -stop will shut down the service easily enough. I can then attach a debugger anywhere I want and this works like any other ASP.NET application. Yes you end up on a background thread for debugging but Visual Studio handles that just fine and if you stay on a single thread this is no different than debugging any other code.SummaryUsing ASP.NET to run background service operations is probably not a super common scenario, but it probably should be something that is considered carefully when building services. Many applications have service like features and with the auto-start functionality of the Application Initialization module, it's easy to build this functionality into ASP.NET. Especially when combined with the notification features of SignalR it becomes very, very easy to create rich services that can also communicate their status easily to the outside world.Whether it's existing applications that need some background processing for scheduling related tasks, or whether you just create a separate site altogether just to host your service it's easy to do and you can leverage the same tool chain you're already using for other Web projects. If you have lots of service projects it's worth considering… give it some thought…© Rick Strahl, West Wind Technologies, 2005-2013Posted in ASP.NET  SignalR  IIS   Tweet !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();

    Read the article

  • Ubuntu 10.10 crashing on initialization, how to solve?

    - by Tom Brito
    Yesterday I installed Ubuntu 10.10, and on the first login it got frozen, so I powered off and on the computer, and it started well. Now, during the updates it got frozen again, and after every login again. I can't even change to the command line with ctrl+f1 or f2. Is there a way to get some log information on the initialization? I have no idea what can be causing this. Previously I was using Ubuntu 9.04, which is now not receiving new updates. Versions 10.04 and 9.10 behavior the same as 10.10, and version 11.04 crashes much on many situations. So, is there a way to get some log information on the initialization to help find what's wrong?

    Read the article

  • Resource Acquisition is Initialization in C#

    - by codeWithoutFear
    Resource Acquisition Is Initialization (RAII) is a pattern I grew to love when working in C++.  It is perfectly suited for resource management such as matching all those pesky new's and delete's.  One of my goals was to limit the explicit deallocation statements I had to write.  Often these statements became victims of run-time control flow changes (i.e. exceptions, unhappy path) or development-time code refactoring. The beauty of RAII is realized by tying your resource creation (acquisition) to the construction (initialization) of a class instance.  Then bind the resource deallocation to the destruction of that instance.  That is well and good in a language with strong destructor semantics like C++, but languages like C# that run on garbage-collecting runtimes don't provide the same instance lifetime guarantees. Here is a class and sample that combines a few features of C# to provide an RAII-like solution: using System; namespace RAII { public class DisposableDelegate : IDisposable { private Action dispose; public DisposableDelegate(Action dispose) { if (dispose == null) { throw new ArgumentNullException("dispose"); } this.dispose = dispose; } public void Dispose() { if (this.dispose != null) { Action d = this.dispose; this.dispose = null; d(); } } } class Program { static void Main(string[] args) { Console.Out.WriteLine("Some resource allocated here."); using (new DisposableDelegate(() => Console.Out.WriteLine("Resource deallocated here."))) { Console.Out.WriteLine("Resource used here."); throw new InvalidOperationException("Test for resource leaks."); } } } } The output of this program is: Some resource allocated here. Resource used here. Unhandled Exception: System.InvalidOperationException: Test for resource leaks. at RAII.Program.Main(String[] args) in c:\Dev\RAII\RAII\Program.cs:line 40 Resource deallocated here. Code without fear! --Don

    Read the article

  • Array Concatenation in C#

    - by Betamoo
    1- How to smartly initialize an Array with 2 (or more) other arrays in C#? double[] d1=new double[5]; double[] d2=new double[3]; double[] dTotal=new double[8];// I need this to be {d1 then d2} 2- Another question: How to concatenate C# arrays efficiently? Thanks

    Read the article

  • Use IIS Application Initialization for keeping ASP.NET Apps alive

    - by Rick Strahl
    Ever want to run a service-like, always-on application inside of ASP.NET instead of creating a Windows Service or running a Console application? Need to make sure that your ASP.NET application is always running and comes up immediately after an Application Pool restart even if nobody hits your site? The IIS Application Initialization Module provides this functionality in IIS 7 and later, making it much easier to create always-on ASP.NET applications that can act like a service.

    Read the article

  • Reduce Repetitive Initialization Code in C++ Applications by Using Delegating Constructors

    You're often required to repeat identical pieces of initialization code in every constructor of a class that declares multiple constructors. That's because unlike a few other programming languages, The C++ programming language doesn't allow a constructor to call another constructor of the same class. Luckily, this problem is about to disappear with the recent approval of a new C++0x feature called delegating constructors which are explained in this C++ tutorial.

    Read the article

  • "initialization error: class file has wrong version" message in JDeveloper 10.1.2.x

    - by [email protected]
    The "initialization error: class file has wrong version" has become a somewhat recurrent error message thrown by JDeveloper 10.1.2.x as newer JDKs have been released in the last years. Note that JDeveloper 10.1.2 was developed to run with JDK 1.4.2. The reasons for this error message to be thrown include: A JDK version higher than 1.4.2 is being used and some unexpected incompatibility conflicts can occur because of that Some of the libraries used on the workspace and/or project were compiled with newer JDK version So, it is strongly recommended to use newer JDeveloper versions (10.1.3 - 11g) for newer JDKs. JDeveloper 10.1.2 will be desupported in December 2010 (or later depending on the support contract). Further information about this can be seen at http://www.oracle.com/support/library/brochure/lifetime-support-middleware.pdf

    Read the article

  • SOA Suite 11g: Unable to start domain (Error occurred during initialization of VM)

    - by Chris Tomkins
    If you have recently installed SOA Suite, created a domain and then tried to start it only to find it fails with the error: Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. the solution is to edit the file <domain home>\bin\setSOADomainEnv.cmd/sh (depending on your platform) and modify the line: set DEFAULT_MEM_ARGS=-Xms512m -Xmx1024m to something like: set DEFAULT_MEM_ARGS=-Xms512m -Xmx768m Save the file and then try to start your domain again. Everything should now work at least it does on the Dell Latitude 630 laptop with 4Gb RAM that I have. Technorati Tags: soa suite,11g,java,troubleshooting,problems,domain

    Read the article

  • Check for Instant File Initialization

    - by TiborKaraszi
    Instant File initialization, IFI, is generally a good thing to have. Check out this earlier blog post of mine f you don't know what IFI is and why it is a good thing: blog . The purpose of this blog post is to provide a simple script you can use to check if you have IFI turned on. Note that the script below uses undocumented commands, and might take a while if you have a large errorlog file... USE MASTER ; SET NOCOUNT ON -- *** WARNING: Undocumented commands used in this script !!! *** -- --Exit...(read more)

    Read the article

  • TDD: Write a separate test for object initialization or relying on other tests exercising it

    - by DXM
    This seems to be the common pattern that's emerging in some of the tests I've worked on lately. We have a class, and quite often this is legacy code whose design can't be easily altered, which has a bunch of member variables. There's some kind of "Initialize" or "Load" function which would put an object into a valid state. Only after it is initialized/loaded, are the members in the proper state so that other methods can be exercised. So when we start writing tests, first test is "TestLoad" and all we put in there is exercising initialization logic. Then we might add one (or few) TestLoadFailureXXX tests and those are definitely valuable. Then we start writing tests to verify other behaviors but all of them require the object to be loaded. So they all start by running exactly the same code as "TestLoad". So my question: Is TestLoad even necessary? Do you take it and let other tests simply exercise the loading? Or leave it so things are more explicit? I know that each unit test function should have no (or as little as possible) overlap with other test functions, but it seems like in cases of loading, this is unavoidable. And whether we like it or not, if something in the loading code breaks, we will end up with a whole test suite of failures. Is there another approach that I might be missing here? Thank you for the responses. It definitely makes sense that you want to see "InitializationTest" and if that fails you know where to start looking. In case it matters, this question is mostly about C++ and we use CppUnit framework. And now, thanks to sleske, I'll be constantly wishing that CppUnit supported test dependencies. Might have to hack something in one of these days :)

    Read the article

  • Oracle BPM: Adding an attachment during the Human Task Initialization

    - by kyap
    Recently I had the requirement from a customer to instantiate a Human Task, which can accept a payload containing a binary attribute (base64) representing an actual document. According to the same requirement, this attribute should be shown as a hyperlink in the Worklist UI to the assignee(s), from which the assignees can download the document on the local machine for review. Multiple options have been leverage, but most required heavy customization.  In order to leverage as much as possible Oracle BPM out-of-the box functionalities, I decided to add this document as a readonly attachment. We can easily achieve this operation within Worklist Application, but it is a bit more challenging when we want to attach the document during the Human Task initialization.  After some investigations (on BPM 11g PS4FP and PS5), here's the way to go: 1. Create an asynchronous BPM process, and use this xsd to create 2 Business Objects FullPayload and PartialPayload : 2. Create 2 process variables 'vFullPayload' and 'vPartialPayload' using this Business Objects created above 3. Implement the Start Event with the initial Data Association, with an input argument using 'FullPayload' Business Object type 4. Drag in an User Task into the process. Implement the User Task as usual by using 'vPartialPayload' type as the input type and assign the task to your favorite tester (mine is jcooper) 5. Here's the main course - Start the Data Association and map the payload into 'execData' as follow: FROM TO  vFullPayload.attachment.mimetype  execData.attachment[1].mimeType  vFullPayload.attachment.filename  execData.attachment[1].name  bpmn:getDataObject('vFullPayload')/ns:attachment/ns:content  execData.attachment[1].content  'BPM'  execData.attachment[1].attachmentScope false()  execData.attachment[1].doesBelongToParent 'weblogic'  execData.attachment[1].updateBy  xp20:current-dateTime()  execData.attachment[1].updateDate (Note: Check the <Humantask>WorkflowTask.xsd file in your project xsd folder to discover the different options for attachmentScope & storageType) 6. Your process is completed. Just build a standard ADF UI and deploy the process/UI onto your BPM Server for the testing. Here's an example, with a base64 encoded pdf file: application-pdf.txt 7. Finally, go to the BPM Worklist application to check the result ! Please note that Oracle BPM, by default, limits the attachment document size to 2Mb. If you are planning to have bigger attachments in your process, it is recommended to store your documents in a Content Management server (such as Oracle UCM) and pass the reference instead. It is possible to configure Oracle BPM to store attachment directly into Oracle UCM too, and I believe we can use the storageType, ucmMetadataItem attributes for this purpose.... I will confirm once I have access onto an Oracle UCM for the testing :)

    Read the article

  • Is it bad practice to have a long initialization method?

    - by Paperflyer
    many people have argued about function size. They say that functions in general should be pretty short. Opinions vary from something like 15 lines to "about one screen", which today is probably about 40-80 lines. Also, functions should always fulfill one task only. However, there is one kind of function that frequently fails in both criteria in my code: initialization functions. For example in an audio application, the audio hardware/API has to be set up, audio data has to be converted to a suitable format and the object state has to properly initialized. These are clearly three different tasks and depending on the API this can easily span more than 50 lines. The thing with init-functions is that they are generally only called once, so there is no need to re-use any of the components. Would you still break them up into several smaller functions would you consider big initialization functions to be ok?

    Read the article

  • call parent constructor in ruby

    - by Stas
    Hi! How can I call parents constructor ? module C attr_accessor :c, :cc def initialization c, cc @c, @cc = c, cc end end class B attr_accessor :b, :bb def initialization b, bb @b, @bb = b, bb end end class A < B include C attr_accessor :a, :aa def initialization (a, b, c, aa, bb, cc) #call B::initialization - ? #call C::initialization - ? @a, @aa = a, aa end end Thanks.

    Read the article

  • HP ACU shows parity initialization failed (with screenshot)

    - by lbanz
    I put in a new drive due to a hard drive failure. When the rebuild got to 100%, the controller fails and I need to reboot the server to bring it online. I had to do this about three times and it eventually finished rebuilding. But I found that it says parity initialization status failed. I've left it for a few hours but it didn't seem to reinitialize. Then I ran the insight online diagnostic tools and it reported the disk that I put in reached read/write error threshold. So I'm beginning to think that the brand new disk I put in is faulty. Before I put in the disk, the parity initialization was at a finished state. Should I replace the new disk I put in? I'm very worried as I think the parity is broken. Or is there a way to kick start the initialization process?

    Read the article

  • Parity Initialization after putting in two new disks

    - by lbanz
    All my firmware is up to date on the server and the controllers. Storage crashed over the weekend. I rebooted it and it detected that I put in two new disks last week (I did check that both disk completed the rebuilding process last week). After it booted into the OS I see that it gave me an information message. After 18 hours it is at 54% so it is looking healthy. But I need to replace 5 more disk in the msa. Should I wait for this message to finish before replacing more disks? 785 Background parity initialization is currently queued or in progress on Logical Drive 1 (15.0 TB, RAID 5). If background parity initialization is queued, it will start when I/O is performed on the drive. When background parity initialization completes, the performance of the logical drive will improve.

    Read the article

  • Class initialization and synchronized class method

    - by nybon
    Hi there, In my application, there is a class like below: public class Client { public synchronized static print() { System.out.println("hello"); } static { doSomething(); // which will take some time to complete } } This class will be used in a multi thread environment, many threads may call the Client.print() method simultaneously. I wonder if there is any chance that thread-1 triggers the class initialization, and before the class initialization complete, thread-2 enters into print method and print out the "hello" string? I see this behavior in a production system (64 bit JVM + Windows 2008R2), however, I cannot reproduce this behavior with a simple program in any environments. In Java language spec, section 12.4.1 (http://java.sun.com/docs/books/jls/second_edition/html/execution.doc.html), it says: A class or interface type T will be initialized immediately before the first occurrence of any one of the following: T is a class and an instance of T is created. T is a class and a static method declared by T is invoked. A static field declared by T is assigned. A static field declared by T is used and the reference to the field is not a compile-time constant (§15.28). References to compile-time constants must be resolved at compile time to a copy of the compile-time constant value, so uses of such a field never cause initialization. According to this paragraph, the class initialization will take place before the invocation of the static method, however, it is not clear if the class initialization need to be completed before the invocation of the static method. JVM should mandate the completion of class initialization before entering its static method according to my intuition, and some of my experiment supports my guess. However, I did see the opposite behavior in another environment. Can someone shed me some light on this? Any help is appreciated, thanks.

    Read the article

  • Is it normal for C++ static initialization to appear twice in the same backtrace?

    - by Joseph Garvin
    I'm trying to debug a C++ program compiled with GCC that freezes at startup. GCC mutex protects function's static local variables, and it appears that waiting to acquire such a lock is why it freezes. How this happens is rather confusing. First module A's static initialization occurs (there are __static_init functions GCC invokes that are visible in the backtrace), which calls a function Foo(), that has a static local variable. The static local variable is an object who's constructor calls through several layers of functions, then suddenly the backtrace has a few ??'s, and then it's is in the static initialization of a second module B (the __static functions occur all over again), which then calls Foo(), but since Foo() never returned the first time the mutex on the local static variable is still set, and it locks. How can one static init trigger another? My first theory was shared libraries -- that module A would be calling some function in module B that would cause module B to load, thus triggering B's static init, but that doesn't appear to be the case. Module A doesn't use module B at all. So I have a second (and horrifying) guess. Say that: Module A uses some templated function or a function in a templated class, e.g. foo<int>::bar() Module B also uses foo<int>::bar() Module A doesn't depend on module B at all At link time, the linker has two instances of foo<int>::bar(), but this is OK because template functions are marked as weak symbols... At runtime, module A calls foo<int>::bar, and the static init of module B is triggered, even though module B doesn't depend on module A! Why? Because the linker decided to go with module B's instance of foo::bar instead of module A's instance at link time. Is this particular scenario valid? Or should one module's static init never trigger static init in another module?

    Read the article

  • Are there any guarantees in JLS about order of execution static initialization blocks?

    - by Roman
    I wonder if it's reliable to use a construction like: private static final Map<String, String> engMessages; private static final Map<String, String> rusMessages; static { engMessages = new HashMap<String, String> () {{ put ("msgname", "value"); }}; rusMessages = new HashMap<String, String> () {{ put ("msgname", "????????"); }}; } private static Map<String, String> msgSource; static { msgSource = engMessages; } public static String msg (String msgName) { return msgSource.get (msgName); } Is there a possibility that I'll get NullPointerException because msgSource initialization block will be executed before the block which initializes engMessages? (about why don't I do msgSource initialization at the end of upper init. block: just the matter of taste; I'll do so if the described construction is unreliable)

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >