Solution/Pattern needed for complex buisiness problem

We currently have a J2EE project built on EJB3 and were hoping to get some help on the design.
A little background: Our company sells several products for various companies. Each of these companies have different business rules, etc. Initially when we built our application we were unable to connect to the companies directly via Web Services, etc. And since we were not communicating with an external service, our input was the same for all of the suppliers (with minor differences). Now some of the suppliers have given access to them via Web Services. Since some have this type of service and other don't we have various iterations of rules, etc. You can see that the problem can grow very large very quickly with the diversity of external and internal services.
We would hate to code our business logic with a bunch of if then else (if (company a) then do this; else if ( . . . )). In addition like I said the input also differs per company so we also need to keep that in mind. Like any good application, we want to ensure that the UI is uniform and that the business logic is easily manageable. We need some form of a plug and play type of pattern that would allow us to manage these various services much easily rather than having to go to every business method to update it for the new supplier.
We were hoping if someone could recommend a solution/pattern that might do us some justice. Thank you in advance.
What we use now: STRUTS, EJB3 (stateless session beans), JBoss 4.04, Hibernate (DAO pattern), AXIS (web services)

We would hate to code our business logic with a bunch
of if then else (if (company a) then do this; else if
( . . . )). In addition like I said the input also
differs per company so we also need to keep that in
mind. Like any good application, we want to ensure
that the UI is uniform and that the business logic is
easily manageable. We need some form of a plug and
play type of pattern that would allow us to manage
these various services much easily rather than having
to go to every business method to update it for the
new supplier.A java rule engine might be the solution you are looking for. http://java.sun.com/developer/technicalArticles/J2SE/JavaRule.html

Similar Messages

  • Solution needed for Blocked material problem

    Hi Guys,
    Scenario  :   There are two plants in a Location(Plant A & B) and a Customer.Now the Material is blocked  so that after the sales order the material will not be allowed to move from Plant A to B as well as the
    material will not be moved to the customer end.
    Solution needed :  I need to move the blocked material from Plant A to Plant B,But the material shouldn't be transferred  to  the customer end.
    How should I proceed for this problem?
    Regards
    Jino.

    hi,
    Theres a functionality in the material master...MRP view were u cld deifne theplant spcfc material status were u cld define the status and even u cld fnd it in Sales organisation data were u cld block for the particular functionality...
    PLS check that and define as per u r reqmnt.. and try
    Hope this helps u out
    Regards,
    sravanthi
    Edited by: Sravanthi683 on Jun 22, 2009 1:45 PM

  • Solution needed for open firmware problem

    I've been helping a friend set up a G4 that another friend had given him, and the firmware got utterly trashed. Here's the problem, the donator wiped the drive for security purposes (which is completely unrelated to the open firmware corruption).
    When I say that its hosed, I mean it. I've tried every boot key sequence known to man. We need to figure out how to re-install (re-flash) the firmware. Its so toasted that when the power on button on the front of the case is pressed it glows for a few secs, then when the o f is supposed to kick in, the button goes dark. There is no boot chime. When powering it down manually using the button it lights up again until the machine is off.
    Let this be a cautionary tale that playing with p-ram is not the safest course.
    System specs:
    G4 2001 Quicksilver 733MHz
    512 MB RAM.

    Hi, Stealth43 -
    Welcome to Apple's Discussions.
    There has never been a firmware update released by Apple for a G4 Quicksilver machine, so even if were possible to re-install one (which it is not), there is none available -
    Article #86117 - Firmware Updates
    The temporary glowing of the power button (only when pressed) usually indicates that the PMU needs to be reset -
    Article #95037 - G4 (AGP) - Resetting PMU
    That article is written around a G4 (AGP) model; however, the procedure also applies to all G4s except the G4 (PCI) model, thus includes QuickSilvers. The location of the PMU button varies from model to model; the location of it for a Quicksilver is shown on this diagram -
    http://img142.imageshack.us/img142/9686/qsdalogicbd8aa.jpg
    Note the warning about pressing the PMU button only once. Holding it down for a few seconds (5 to 10 or so) is okay, but do not press it again until the machine has been power-cycled.
    In addition, if the battery in that machine has never been replaced it is time to do so - it has an expected life of only 4 to 5 years under ideal conditions. A too-weak or dead battery can cause booting problems. You can get a replacement at places like Radio Shack for about US$16, cheaper on-line.

  • Urgent Help is Needed for Database Installation Problems

    How can we resolve the following database problems in Windows XP? Originally, we had Oracle 10.1.0.4.2, and we wanted to upgrade it to Oracle 10.2.0.1. We uninstalled Oracle Home ORAH1_DEV and then got the following problems while installing Oracle 10.2.0.1. How can we resolve all these errors so database configuration assistants can work successfully? Please help us with these ASAP. Thank you very much for your help and time in advance.
    -Oy
    These are the popup message we got.
    POPUP 1. This appears 3 times, then ignore
    Error in writing to file 'C:\OraHomes\ORAH1_DEV\jdk\jre\bin\awt.dll'.[C:\OraHomes\ORAH1_DEV\jdk\jre\bin\awt.dll(The process cannot access the file because it is being used by another process)]
    Click 'Help' for more information
    Click 'Retry' to try again
    Click 'Ignore' to ignore this error and go on.
    Click 'Cancel' to stop this installation
    buttons Help Retry Ignore Cancel
    POPUP 2. Error in writing to file 'C:\OraHomes\ORAH_DEV\jdk\bin\java.exe'. [C:\OraHomes\ORAH1_DEV\jdk\jre\bin\java.exe (The process cannot access the file because it is being used by another process)]
    Click 'Help' for more information
    Click 'Retry' to try again
    Click 'Ignore' to ignore this error and go on.
    Click 'Cancel' to stop this installation
    buttons Help Retry Ignore Cancel
    POPUP 3. Erro in writing to file 'C:\OraHomes\ORAH1_DEV\bin\orancrypt10.dll'. [C:\OraHomes\ORAH1_DEV\bin\orancrypt10.dll (The process cannot access the file  because it is being used by another process)]
    Click 'Help' for more information
    Click 'Retry' to try again
    Click 'Ignore' to ignore this error and go on.
    Click 'Cancel' to stop this installation
    buttons Help Retry Ignore Cancel
    POPUP 4. Error in writing to file 'C:\OraHomes\ORAH1_DEV\bin\oravsn10.dll'. [C:\OraHomes\ORAH1_DEV\bin\oravsn10.dll (The process cannot access the file because it is being used by another process)]
    Click 'Help' for more information
    Click 'Retry' to try again
    Click 'Ignore' to ignore this error and go on.
    Click 'Cancel' to stop this installation
    buttons Help Retry Ignore Cancel
    POPUP 5. Error in writing to 'c:\OraHomes\ORAH1_DEV\opmn\mesg\ensus.msb'. [C:\OraHomes\ORAH1_DEV\opmn\mesg\ensus.msb (The process cannot access the file because it is being used by another process)]
    Click 'Help' for more information
    Click 'Retry' to try again
    Click 'Ignore' to ignore this error and go on.
    Click 'Cancel' to stop this installation
    buttons Help Retry Ignore Cancel

    Grace wrote:
    Yes, I have it installed in the same Oracle Home. Is it possible to create it there? Or I must create a new Oracle Home for the new installation? Please reply as soon as possible. Thank you very much for your help.
    -OyA specific ORACLE_HOME holds the binaries for a specific version of Oracle. You don't upgrade by simply installing a newer version of Oracle into the ORACLE_HOME of an older version. If you tried to do that you have probably irreversibly corrupted the original installation.
    And there is no URGENT or ASAP here. We are all volunteers with regular jobs. If you have "urgent" support issues you need to open a Service Request with Oracle Support.

  • Help needed for WiFi connection problem

    Hello
    My wife's iPad2 with current iOS 8.3 sometimes will not connect to Wi-Fi - any ideas on how to correct the problem?
    It's inconsistent! 
    Thanks for any thoughts about this.
    David

    If you want to do this in sql you've to use dynamic sql to select only columns having the data.
    And you can always use end user tools like SSRS to display only columns having values by using expression for visibility property.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
    Visakh16-
                    Can you please help me on how can I achieve this using SSRS. 
    Thanks.
    Hi Mutali,
    Personally, I don't recommend using SSRS.
    If you want to design a SSRS report,you should retireve all columns and specify column visibility for each column with following expression.
    =IIF(Fields!SomeFieldValue.Value > 0, True, False)  (Note:Supposing the data type of the field is INT).
    You can refer to the solution as
    Jingyang Li post above.
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Design Patterns needed for SAP XI

    Hi

    hi,
    Here are the general step for designing for file to r/3 integration using IDOC,RFC
    After doing this ull get good idea abt the sap xi designing
    To Configure the FILE TO SAP R/3 OR SAP R/3 TO FILE, proceed as follows:
    Step1:Repository
    1      From the Integration Builder page, select “Integration Repository”. This will launch the Java Web Start Application. Log with the User id and password from the  Integration Server.
    2.      Choose Tools->Transfer from System Landscape Directory->Import Software Component Versions
            From the list of Software Component Versions, Choose your own software component version .Click Import.
    3      On the left hand side frame ,software components will appear .Select your own software component. Open your own software component. Double click on this  software component. A screen will appear .Switch to display mode. After doing this first add  a namespace under Namespaces.
            The namespace should always begin with urn:
    4.     Then choose the Radio Button ->Import of RFC AND IDOC interfaces from SAP systems permitted
         After this specify the connection parameters to the R/3 system:
         System  : Name of sap R/3 system
         Client     : Sap R/3 client number
         These two fields are mandatory. You must Specify these fields.
         Then Save it. The new namespace will be visible under software component version node in the left frame.
         Under the namespace node,  you will find the section Imported Objects. Right click on it and choose Import of sap objects. A wizard will display. In the wizard provide the following details.
    Application server:IP address of sap r/3 system.
    System number: Number of sap r/3.
    User name: user name of sap r/3 .
    Password: Password of sap r/3 system.
            Then click continue .You will find IDOC and RFC node. Click on this node and select the   Idoc or Rfc which is to be imported from R/3. Click Finish to start the Import. Close the wizard. After doing this the   Rfc and  Idoc will be available into XI as Message types. So no need to create any Rfc or Idoc Structure. We need to create a structure for file only.
    5.      Under your namespace in the left frame, expand the node “Interface objects”. You will find a node “DATA TYPES”
    6       Create new data types.
            Right click on “Data types” and select “New”.  Give a suitable name to Data Type(DT_datatype). In the data type Editor ,Create a structure having Elements of type String  ,  integer,  Boolean , Float etc as per the requirement.
            Save the object.
    6.2     The Import function for XSD  files enables you to upload message definitions from external sources. The object type “External Definition” is a container to make external definitions available in the Integration Repository.. While Importing the XSD files from “External Definition “
            no need to create Data types. They are imported directly as Message types.
            To do so, In the left hand frame  Under  ” Interface objects” Create a new object of type “External Definition” and give name to it.
         Select the following.
    Category: XSD.
    Messages: From All Available Global Elements.
    File: Here we need to specify the file name(file.xsd)
         Once the XSD is imported, click on “Message” tab , You should be able to see 2 messages(Request and Response)
    7.       Create a new Message  Type.
    7.1      In the left hand frame under “Interface objects”, right click on the “Message types” and select new.
    7.2      Give a suitable name to the Message type.(MT_ messagetype).
    7.3      For the section “Data type used” you can go to input help (F4) or Search help provided and choose your data type (DT_datatype) from there.
             Save it.
    8.         Create a “Message interface” from the left frame and name(MI_ messageinterface) it.The interface Should be  Inbound or Outbound and mode should be Asynchronous  .It should reference your Message type(Use F4 or Search help).
               Save it.
    9.         Create a graphical mapping  between the target document and the sender .
    9.1        In the left hand frame ,expand “Mapping objects”. Right click on “Message mapping” and name it.You are now in a graphical editor.The Source message is on left, the Target message is on right.
    9.2        As Source message select  your own Idoc , Rfc  or Message type.You can choose “Search  for Integration Object”.As a reminder you can find your Idoc or Rfc under Software Component-  >     Namespace->Imported Objects.
    9.3       As Target Message you can choose your Message type or Idoc, Rfc .Choose “Search  for Integration Object”.
    9.4      Now that we have defined the  Source and Target message, we can start defining the Mapping rules.
    9.5       Map the fields of  Source document  to the equivalent fields in  Target document .This can be achieved easily by locating the field in Target document and then Drag and Drop the   Source fields to the respective Target Fields.
         Save It.
         You can also Test your Mapping by selecting the Test Tab.
    9.6     Fill in the values in the Idoc fields and click Start Transformation. On the right hand side you will see Target Document populated with the appropriate Values.
    10.      Create an “Interface Mapping”.
         In the left hand Frame  expand “Mapping objects”. Right Click on “Interface Mapping” and  Name it. You are in a Interface Mapping Editor .Assign the following References.
    Source interface : Your Outbound Interface (Idoc from the Software component Version).You can Choose” Search  for Integration Object”.
    Target interface:    Your Inbound Interface( The Target document interface).
         Then Select  Read Interface and Assign your “ Mapping Program” .
    Mapping Program: Your Message mapping.
         Then Save it.
    11.      Finally , in the left hand frame ,go to your change list and Activate it.
    Rewards points if helpful
    Vikas

  • Help needed for white screen problem with no shortcuts working on startup.

    Im using a 20" mac OS X with leopard, When IMac turns on there is just a white screen with nothing happening so Iv tried using all of the shortcut command keys such as "command+R" with no success.
    My main question is which cd will I need to get a hold of so i can completetly wipe the imac and start again fresh?
    Any help will be appreciated.
    Unsure of operating system being used as cant get onto Mac.

    The install disc that shipped with the machine. Running Leopard and there's no recovery HD (CMD+R) feature. That only came with Lion.

  • Need for speed carbon problems

    when i start the game
    i can hear the sounds but black screen
    does anyone can help me?
    i work on os x 10.5.5
    mbp 17" 2.6c2d
    8600 with 512 vram

    i don't backed up my computer so far
    but i quit the nfsc
    my screen comes back
    only process the nfsc it comes black screen
    also i want to thank u ur help
    haha~
    and pls forget my poor english

  • I need some detail solutions and suggests about below these problems ?

    I need some detail solutions and suggests about below these problems:
    Problem 1: SAP Management Console cannot start successfully
    • Problem 1.1: Click on SAP Management Console, but yellow light continues for a long period of time.
    • Problem 1.2: In DOS, startsap command cannot start SAP R/3.
    • Problem 1.3: Oracle 9i database automatically shutdown by itself.
    • Problem 1.4: There is very low disk storage left (say less than 50MB) in the hard disk where Oracle 9i database is installed in the server.

    3.1 - If you client copy from client 000, you need to go to SCC4 and set the client to customizing chnages allowed;
    3.2 - If you do a client copy from client 800 (the one that SAP delivers data in) you should have data. Client 000 is empty (almost).
    3.3 - You should be able to change the password of SAP* PASS user.
    I am not sure which version you are dealing with, but ERP2004 and ERP2005 allow you to change the password suring installation.
    Also, there is a parameter that can be maintained that allows you to log on as SAP*. If you set as not available, no one can log on.
    Hope it helps,
    Leonardo De Araujo

  • Need HP solution center software for hp psc 2110 running windows 7 32 bit

    Hi,
    The HP Solution Center Software has disappeared since I upgrade my HP laptop OS from Vista to Windows 7 32 bit.  I use the HP Solution Center Software for years to create .pdf documents from the scanned documents of my HP PSC 2110 All-in-One printer.
    Can you provide the link to download the HP Solution Center Software for Win 7? I searched the HP support website using the product name HP PSC 2110, it pointed me to the driver section; I followed the instructions however there is no link to download the the software.
    The printer is connected via USB and works well.  It is just annoying I cannot use the HP Solution Center Software (previously HP Director) to copy scanned documents to my computer.
    Thanks.
    This question was solved.
    View Solution.

    You are welcome.
    You may download it from the following link:
    http://sourceforge.net/projects/naps2/files/3.0b1/​naps2-3.0b1-setup.exe/download
    That means that as an older model its functionality is limited but there are some workarouds available. it surely worth trying.
    For a Wirelss printer you will need a different printer indded, there are many factors to consider and recommend you any specific printer, do you have any specific needs? for example would you use a fax or not, I assume it should be a color printer with a scanner... do you use to print photos or use it more often for a daily printing and scanning capabilities, those factors may highly affect any possible recommendation so further clarification will be helpful.
    Regardless, any current HP device with a scanner fully support scanning PDF scanning within the HP Software.
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • Hi! I can't upgrade my iTunes 10.3.1.55 on my Windows XP 2002 SP3 to the latest version of iTunes. Got the message: "A problem has occured with the Windows Installer-package. A program needed for this installation could not be run." What to do?

    Hi! I can't upgrade my iTunes 10.3.1.55 on my Windows XP 2002 SP3 to the latest version of iTunes. Got the message: "A problem has occured with the Windows Installer-package. A program needed for this installation could not be run." What to do?

    Perhaps let's first try updating your Apple Software Update.
    Launch Apple Software Update ("Start > All Programs > Apple Software Update"). Does it launch and offer you a newer version of Apple Software Update? If so, choose to install just that update to Apple Software Update. (Deselect any other software offered at the same time.)
    If the ASU update goes through okay, try another iTunes install. Does it go through without the errors this time?

  • Need a fix for Muse upload problems to GoDaddy????  I found one!

    GoDaddy now has a new cpanel named "Plesk".  In that panel you will find File Manager.  (I use the Windows version).  In the left panel of File Manager, you will see the root directory and all of its subfolders.  When you click on any of these folders, you will see their contents in the right panel.  You will also see a folder labelled "httpdocs".  This is the default folder that is set up in GoDaddy to be your "home" folder.  So, to fix your upload problems, do these steps:
    1.  Click on the httpdocs folder to see it open in the right panel.  In the toolbar above the right panel, you will see a green plus sign with the word "New".  Click on this drop-down menu.
    2.  Choose "directory"
    3.  Type in the name of one of the folders that your site will need, e.g. images, css, assets, scripts, etc.  This basically creates a subfolder within the httpdocs folder, right?  (There is a way to see how your Muse site sets up these folders prior to publish or upload.  You do this by choosing "Export as HTML" in the File menu of Muse, creating a folder on your desktop (or wherever) for the HTML export, then inspecting its contents after your save it.)
    4.  Continue to create all the subfolders within httpdocs that you will need.  Unfortunately, you have to do this one folder at a time.
    5.  After you have them set up, begin the process of uploading your site, like this:
    6.  In the File menu in Muse, you'll of course see "Upload to FTP Host ...".  Click on it.
    7.  A dialog box will open.  In the top text field, type in your website name ... you must use www. with your entry
    8.  In the "FTP Host" field, type in your domain name again like this ... "ftp.yourdomain.com" ... NO FORWARD SLASHES!!! (even if you find instructions to the contrary, like in Filezilla)  (Also, your domain might be a .org or .net, instead of a .com)
    9.  In the "Host directory" field, YOU MUST ENTER "httpdocs"!!!!  Despite what you learn, DO NOT LEAVE THIS FIELD BLANK!!!
    10.  Then enter your GoDaddy username and password.  (If you set up a different username for your GoDaddy account and your Plesk account, like I did, then use your Plesk username and password.)
    11.  Click on "Upload:  All Files"
    The next few steps are tedious, but necessary to keep your site organized on GoDaddy and to keep from confusing things.  You can probably get away with it, but, if your site doesn't load properly in a browser after doing the above steps, you'll need to click on each folder in the root directory that you copied as a subfolder in the "httpdocs" folder and delete the files.  For example, in the left panel of File Manager, you'll see the root directory.  Click on the "images" folder.  If there are any images that you need for your site in that folder, delete them.  Remember ... you've already copied them over to the images subfolder in httpdocs during your last upload described in the instructions above.  If you don't trust that you can delete them, click on the "httpdocs" folder, then click on the "images" folder and check the files.  Same files, right?  So, go ahead and delete the site files that you find in the appropriate folders in the root directory, making sure that you don't delete the ones that are NOT duplicated within the "httpdocs" folder.  Also remember that your .html pages will not require a subfolder to be set up in the "httpsdocs" folder.  They can just sit there, looking pretty.  But you will have to delete them from the root directory to keep things tidy.  Just click on the folder icon next to "root directory", and you'll see those html pages in the right panel.  Again, delete them. 
    REMEMBER:  To keep your Muse uploads to your GoDaddy site error free, you must ALWAYS make sure that "httpdocs" appears in the "Host directory" field in the "Upload to FTP Host ..." dialog box in Muse.  And all files and folders that your site needs MUST go in the "httpdocs" folder in the root directory of your site in GoDaddy's File Manager (now found in your Plesk Panel).
    I hope this wasn't too confusing.  If so, call GoDaddy.  I called them with this fix and they are using it in their phone support.

    Thank you! Thank you! Thank you! I was going out of my mind. And GoDaddy was no help (although they're usually really good.) I put all the folders in "httpdocs" and the website worked perfectly!

  • A solution for iTunes install problems

    I upgraded to the latest ver of iTunes and immediately had ALL the problems posted all over the 'net.
    The following is what worked for me.
    BACKUP!!! Set a Restore Point. Back up your REGISTRY. It is critical that you back it up beforehand and use caution while cleaning it. Please do this in case everything goes T. U.
    Remove all references to iTunes, iPod and Quick Time. There are literally thousands and you must get rid of all of them.
    Find, download, install a copy of jv16 Power Tools.
    Then:
    1. BACKUP! Set Restore Point! Back up your Registry! Did I mention backing up?
    1a. Be very careful cleaning out the Registry. Take your time. Go slowly. Make sure that what you delete is only iTunes-related. Check twice before deleting. Take. Your. Time.
    1b. The Registry is your PCs mind; do not scramble it. You will be sad.
    2. Using jv16s Software Manager, uninstall iTunes, iPod and Quick Time.
    3. Using jv16s Registry Finder, one at a time, search for and delete ALL references to iPod, iTunes, Quick Time and Apple Computer (BE CAREFUL; it will give you references to various 'applets" and "appletalk"; do NOT delete those. Only Apple Computer stuff.)
    4. Using Microsofts Search function, search for all remaining references to iTunes, iPod, Apple Computer (leave applets alone) and most importantly-Quick Time.
    5. When you are certain that everything that says Apple Computer, Apple, iPod, iTunes and Quick Time exists no more on your PC, Reboot.
    6. Go to www.old-software.com and download an old copy of iTunes. The one that finally worked for me was iTunes v 6.0.5
    7. Install an old version of iTunes. DO NOT USE THE LATEST VERSION OF iTUNES! Thats what caused the problems in the first place.
    8. Reboot.
    Even though you previously "uninstalled" iTunes, probably using the Add Remove Programs application in Control Panel, there remains behind thousands of pieces, parts and references to iTunes and Quick Time, in the Registry, TEMP files, Documents and Settings (Application Data and Local Settings), in Windows/system32 and a hundred other places. You gotta get rid of it all.
    Quick Time seems to be the main culprit, but in the end I had to get rid of all traces of all of the Apple applications before I could install again and get it to work.
    It took me 3 days to figure out this procedure but once I did, it took only an hour to do it.
    I've seen a couple other procedures recently posted here that look good. If you are uncomfortable with going into the Registry, try one of those others first.
    And fer cryin' out loud, Apple. Yank the latest version of iTunes off your site. I did a Google search for "iTunes installation problems" and came up with 700,000 hits. Do ya think you might have a problem?
      Windows XP   Try testing your upgrades before releasing them!

    Im trying your method right now, when im finished ill let you know how it worked out. I agree with your comment on apple needing to pull the latest version and get a version that actually works.

  • I can't download the apps with big size like need for spees, but in apps with normal size(less than 100KB)there is no problem,is there any body who can help me?

    I can't download the apps with big size like need for spees

    Have a little patience. 4 minutes is only a short time for someone to find your post and reply to it. Also clicking on "This Solved My Problem" marks your problem as solved so many folks that may otherwise help will pass the question by since it is "solved."
    I suggest you start a new question that gives a good title to a specific problem. Then in the body of the thread describe the problem in detail, tell us what steps you have tried so far to correct the problem, what happened, and what error messages you received.

  • Hard Drive warning when upgrading to Mountain Lion. 2 try and I was able to upgrade. Software update for IPhoto, had problems restarting. Do I need my hard drive checked

    Hard Drive warning when upgrading to Mountain Lion. 2nd try and I was able to upgrade. Software update for IPhoto, had problems restarting. Do I need my hard drive checked

    Yes.
    Choose Apple menu > Restart. Hold down the Command (⌘) and R keys as your computer restarts.
    When you see a white screen with an Apple logo in the middle, you can release the keys.
    Click Disk Utility, and then click Continue.
    In the list at the left, select the item you want to repair. (Be sure to select an item that’s indented to the right in the list, not an item at the far left.)
    Click First Aid.
    If Disk Utility tells you the disk is about to fail, back it up and replace it. You can’t repair it.
    Click Repair Disk.
    If Disk Utility reports that the disk appears to be OK or has been repaired, you’re done.
    Otherwise, you may need to do one of the following steps.
    If Disk Utility can’t repair your disk or it reports “The underlying task reported failure,” try to repair the disk or partition again. If that doesn’t work, back up as much of your data as possible, reformat the disk, reinstall Mac OS X, and then restore your backed-up data.
    If you continue to have problems with your disk, it may be physically damaged and need to be replaced

Maybe you are looking for