<PAGE>

                                                                    Exhibit 10.4

                            ONYX SOFTWARE CORPORATION

                             STOCK OPTION AGREEMENT

I.    OPTION GRANT. As approved by the Committee, ONYX SOFTWARE CORPORATION, a
      Washington corporation (the "Company"), hereby grants a nonqualified stock
      option to purchase a total of 125,000 shares of Common Stock of the
      Company, par value $0.01 per share, (the "Common Stock") as of June 7,
      2004 ("Grant Date") to JANICE P. ANDERSON (the "Optionee"), subject in all
      respects to the terms and provisions of this Stock Option Agreement (the
      "Option"). This Option shall be governed by, and construed in accordance
      with, the laws of the state of Washington without regard for principles of
      conflict of laws.

II.   VESTING SCHEDULE. The Initiation Date shall be June 7, 2004. This Option
      shall vest and become exercisable as to 25% of the total number of shares
      of Common Stock covered by this Option on the one year anniversary of the
      Initiation Date and an additional 2.0833% of the total number of shares
      originally covered by the Option shall vest each month thereafter, with
      the result that the Option shall be fully vested and exercisable four
      years after the Initiation Date.

      A.    Acceleration Upon Qualifying Termination. If Optionee's employment
            with the Company is terminated as a result of a Qualifying
            Termination, this Option shall, upon the effectiveness of the
            Release executed by Optionee, automatically vest and become
            exercisable for that portion of this Option that would have vested
            if Optionee had remained in the employment of the Company through
            and including the first anniversary of the date of such termination
            of employment.

      B.    Acceleration Upon Death or Disability. If Optionee's employment with
            the Company is terminated as a result of Optionee's death or
            Disability, this Option shall, upon the effectiveness of the Release
            executed by Optionee (or her personal representative if applicable),
            automatically vest and become exercisable for that portion of this
            Option that would have vested if Optionee had remained in the
            employment of the Company through and including the first
            anniversary of the date of such termination of employment.

      C.    Acceleration Upon Corporate Transaction. In the event of a Corporate
            Transaction, that portion of this Option that is at the time
            outstanding shall automatically accelerate so that this Option
            shall, immediately prior to the specified effective date for the
            Corporate Transaction, become 100% vested and exercisable.
            Notwithstanding the foregoing, this Option shall not so accelerate,
            however, if and to the extent that this Option is, in connection
            with the Corporate Transaction, either to be assumed by the
            successor corporation or parent thereof (the "Successor
            Corporation") or to be replaced with a comparable option for the
            purchase of shares of the capital stock of the Successor
            Corporation. The determination of option comparability shall be made
            by the Committee, and its

<PAGE>

            determination shall be conclusive and binding. If this Option is not
            assumed by the Successor Corporation, or if it is replaced with a
            comparable option for the purchase of shares of the capital stock of
            the Successor Corporation, it shall terminate and cease to remain
            outstanding immediately following the consummation of the Corporate
            Transaction, or the granting of the comparable option, as
            applicable.

      D.    Acceleration Upon Qualifying Termination Following Change of
            Control. If Optionee's employment with the Company is terminated as
            a result of a Qualifying Termination occurring within 24 months
            after a Change of Control (or if pursuant to Section 14(c) of the
            Employment Agreement, such employment is deemed to have been
            terminated as a result of a Qualifying Termination occurring within
            24 months after a Change of Control), upon the effectiveness of the
            Release executed by Optionee, the portion of the Option that is then
            outstanding and unvested shall automatically fully vest and become
            immediately exercisable.

III.  PRICE. The Option exercise price per share (the "Exercise Price") as
      determined by the Committee is $5.50 which is a premium to the fair market
      value of a share of Company Common Stock. The Exercise Price shall be paid
      by delivery of cash or, subject to the discretion of the Committee, by
      delivery of an approved equivalent to cash.

IV.   PURCHASE FOR INVESTMENT. This Option may not be exercised if the issuance
      of shares of Common Stock pursuant to an exercise would constitute a
      violation of any applicable federal or state securities or other law or
      valid regulation. Any other provision of this Option notwithstanding, the
      obligation of the Company to issue shares pursuant to an exercise of the
      Option shall be subject to all applicable laws, rules and regulations and
      such approval by any regulatory body as may be required. The Company
      reserves the right to restrict, in whole or in part, the delivery of
      shares prior to the satisfaction of all legal requirements relating to the
      issuance of such shares, to their registration, qualification or listing
      or to an exemption from registration, qualification or listing.
      Notwithstanding the foregoing, the Company reaffirms its obligations
      pursuant to Sections 6(f) and 6(g) of the Employment Agreement.

V.    NON-ASSIGNABILITY. The Option may not be transferred or hypothecated in
      any manner and shall only be exercisable by the Optionee or her legal
      representative. The terms of this Option shall be binding upon the
      executors, administrators, heirs, successors, and assigns of the Optionee.

VI.   EXERCISE.

      A.    Upon the termination of Optionee's employment with the Company, this
            Option shall be exercisable, to the extent of the number of shares
            purchasable by Optionee that are vested at the date of such
            termination after giving effect to the vesting acceleration
            provisions of this Option if applicable and, for subparts (a) and
            (b) below, contingent on the effectiveness of the Release and the
            Optionee's continuing compliance in all material respects with such
            Release, only (a) within one year after such termination if the
            Optionee's termination is coincident with

                                       2
<PAGE>

            the Optionee's death or Disability, (b) within 180 days after a
            Qualifying Termination (unless such Qualifying Termination has
            occurred (or pursuant to Section 14(c) of the Employment Agreement
            is deemed to have occurred) within 24 months of a Change of Control
            in which this Option was assumed by the Successor Corporation, in
            which case this Option shall remain exercisable until the one-year
            anniversary of such Qualifying Termination) or (c) within 90 days of
            the date that Optionee ceases to be an employee, director, officer,
            consultant, agent, advisor or independent contractor of the Company
            or a subsidiary (collectively, "Service") if Optionee's employment
            is terminated for any other reason, but in no event later than the
            remaining Term of the Option. Any portion of this Option exercisable
            at the time of the Optionee's death may be exercised by the personal
            representative of the Optionee's estate or the person(s) to whom the
            Optionee's rights under the Option have passed by will or the
            applicable laws of descent and distribution. This Option may be
            exercised only for whole shares of Common Stock. Any unvested
            portion of this Option (after giving effect to the acceleration
            provisions of this Option) shall expire and will be immediately
            canceled upon cessation of Optionee's Service. Any unexercised
            portion of this Option shall expire and will be immediately canceled
            upon the earlier of the end of the Term or, if applicable, the date
            specified above in subparts (a), (b) or (c). All shares subject to
            any such canceled portion shall no longer be available for purchase
            or issuance under this Option. In connection with any proposed same
            day exercise and sale transaction to be completed through Optionee's
            personally-selected broker, the Company will agree to use
            commercially reasonable efforts to assure such broker that shares
            will be timely delivered upon exercise of this Option, and payment
            of the exercise price therefor, in accordance with the terms hereof.

      B.    This Option may not be exercised more than ten (10) years from the
            date hereof (the "Term"), and may be exercised during the Term only
            in accordance with the terms and provisions set forth herein.

      C.    This Option may be exercised for all or part of the shares eligible
            for exercise by presenting a written notice (the "Notice") to the
            Company that this Option is exercised in strict accordance with the
            terms and provisions of this Option. The Company shall determine in
            good faith whether or not the Notice complies with the terms and
            provisions of this Option. Such Notice shall identify this Option,
            state the number of shares as to which the Option is exercised and
            be signed by the Optionee. Delivery of the cash or cash equivalent
            in payment for the shares to be purchased pursuant to the exercise
            of this Option shall accompany the Notice. If the Optionee is
            deceased, the Notice shall be signed, and if the Optionee has a
            Disability, it may be signed, by the Optionee's legal
            representatives or beneficiaries, and in all instances shall be
            accompanied by evidence satisfactory to the Company and its transfer
            agent of the right of such person or persons to exercise this
            Option.

      D.    The Optionee shall make arrangements satisfactory to the Company for
            the satisfaction of any withholding tax obligations that arise in
            connection with her

                                       3
<PAGE>

            Option. The Company shall not be required to issue any shares of
            Common Stock until such obligations are satisfied.

VII.  EFFECT OF CHANGE IN COMMON STOCK SUBJECT TO OPTION. If the outstanding
      shares of Common Stock shall at any time be changed or exchanged by
      declaration of a stock dividend, split-up, combination of shares, or
      recapitalization, the number and kind of shares subject to this Option,
      and the Exercise Price, shall be appropriately and equitably adjusted so
      as to maintain the proportionate number of shares subject to this Option
      and the Exercise Price in relation to the change in stock; provided,
      however, that no adjustment shall be made by reason of the distribution of
      subscription rights on outstanding stock. Any such adjustment of shares
      subject to this Option shall be rounded down to the nearest whole number
      of shares and in no event shall the Company be required to issue
      fractional shares or provide any consideration to Optionee related to the
      forfeiture of any putative fractional shares.

VIII. ADMINISTRATION; AMENDMENT OR ALTERATION. This Option shall be administered
      by the Committee. The Committee shall have exclusive authority, in its
      discretion, to determine all matters relating to this Option, including
      all terms, conditions, restrictions and limitations of this Option. The
      Committee shall also have exclusive authority to interpret the Option and
      may from time to time adopt, and change, rules and regulations for the
      Option's administration. The Committee's interpretation of the Option and
      its rules and regulations, and all actions taken and determinations made
      by the Committee pursuant to the Option, shall be conclusive and binding
      on all parties involved or affected. The Committee may delegate
      administrative duties to such of the Company's officers as it so
      determines.

      Without limiting the foregoing, the Committee may amend or alter this
      Option, except that no amendment or alteration shall be made which would
      impair the rights of the Optionee hereunder, without her consent, and,
      except further, this Option shall be subject to the requirement that, if,
      at any time the Committee shall determine, in its discretion, that the
      listing, registration or qualification of the stock issuable or
      transferable upon exercise thereof upon any securities exchange or under
      any state or federal law or the consent or approval of any governmental
      regulatory body is necessary or desirable as a condition of, or in
      connection with, the granting of this Option or the issue, transfer, or
      purchase of shares hereunder, this Option may not be exercised in whole or
      in part unless such listing, registration, qualification, consent, or
      approval shall have been effected or obtained free of any conditions not
      acceptable to the Committee. All determinations made and all actions taken
      by the Committee with respect to this Option shall be made or taken, as
      applicable, in good faith.

IX.   OPTION NOT A SERVICE CONTRACT. This Option is not an employment contract
      and nothing in this Option shall be construed as giving Optionee any right
      to be retained in the employ of the Company or limit the Company's right
      to terminate the employment or services of Optionee.

                                       4
<PAGE>

X.    OTHER AGREEMENTS. In the event of any discrepancy between this Stock
      Option Agreement and the Employment Agreement, the terms of the Employment
      Agreement shall prevail.

XI.   NO RIGHTS AS A SHAREHOLDER. The Optionee, or a transferee of the Optionee,
      shall have no rights as a shareholder with respect to any Common Stock
      covered by the Option until such person becomes entitled to receive such
      Common Stock by filing a Notice, paying the Exercise Price pursuant to the
      terms of this Option and receiving a share certificate from the Company
      for such Common Stock.

XII.  DEFINITIONS. If not elsewhere defined, the following definitions shall be
      applicable for this Option:

      "Board" means the Company's Board of Directors.

      "Cause" means any one of the following: (i) a willful and continued
      failure to perform the Optionee's duties and responsibilities as President
      and Chief Executive Officer, other than a failure resulting from the
      Optionee's complete or partial incapacity due to physical or mental
      illness or impairment, after there has been delivered to the Optionee a
      written demand for performance from the Board that describes the basis for
      the Board's belief that the Optionee has not performed her duties and
      provides the Optionee with (thirty) 30 days (or such longer period of time
      as may be granted by the Board in its sole discretion) to take corrective
      action, (ii) a willful act by the Optionee that constitutes gross
      misconduct and that results in material harm to the Company, (iii) a
      willful breach by the Optionee of a material provision of this Agreement
      or (iv) a material and willful violation of a federal or state law or
      regulation applicable to the business of the Company that results in
      material harm to the Company. For purposes of this Agreement, no act, or
      failure to act, on the Optionee's part shall be deemed "willful" unless
      done, or omitted to be done, by the Optionee not in good faith and without
      reasonable belief that the Optionee's action or omission was in the best
      interest of the Company. Notwithstanding the foregoing, the Optionee shall
      not be deemed to have been terminated for Cause unless and until the
      Company provides written notice to the Optionee by providing a copy of a
      resolution duly adopted by the affirmative vote of not less than
      three-quarters of the entire membership of the Board (other than the
      Optionee), and including at least a majority of the independent members of
      the Board (as defined in Nasdaq Rule 4200(a)(15)) (the "Independent
      Directors"), as it may be amended from time to time), at a meeting of the
      Board called and held for such purpose (after reasonable notice to the
      Optionee and an opportunity for the Optionee, together with counsel, to be
      heard before the Board) finding that, in the good-faith opinion of the
      Board, the Optionee was guilty of conduct set forth above and specifying
      the particulars thereof in reasonable detail. If the Company does not give
      Optionee notice of termination for Cause within sixty (60) days following
      the date an Independent Director first has actual knowledge of the
      material facts giving rise to the basis for such termination, the Company
      shall be deemed to have irrevocably waived the right to give notice on
      such basis unless Optionee consents in writing to an extension of such
      sixty (60) day period. For purposes of the foregoing waiver provision, the
      Optionee shall have the burden of proving actual knowledge of an
      Independent Director of the material facts giving rise to the basis for
      such termination.

                                       5
<PAGE>

      "Change of Control" means any of the following events: (i) consummation of
      any merger or consolidation or reorganization of the Company in which the
      Company is not the continuing or surviving entity, or pursuant to which
      shares of the Common Stock are converted into cash, securities or other
      property, if (and only if) following such merger or, consolidation or
      reorganization, the holders of the Company's outstanding voting securities
      immediately prior to such merger or, consolidation or reorganization own
      less than a majority of the outstanding voting securities of the surviving
      entity or members of the Company's board of directors immediately prior to
      such merger, consolidation or reorganization do not constitute a majority
      of the board of directors of the surviving entity; (ii) consummation of
      any sale, lease, exchange or other transfer in one transaction or a series
      of related transactions of all or substantially all of the Company's
      assets other than a transfer of the Company's assets to a majority-owned
      subsidiary corporation of the Company; (iii) approval by the holders of
      the Common Stock of any plan or proposal for the liquidation or
      dissolution of the Company; (iv) acquisition by any person or group of
      beneficial ownership (as defined in the Securities Exchange Act of 1934,
      as amended) of more than 50% of the Company's outstanding voting
      securities; or (v) if those individuals who are directors of the Company
      on the date of the Optionee's employment (the "Incumbent Board") cease to
      constitute a majority of the Company's directors, provided that
      individuals whose election as directors was approved by the Incumbent
      Board shall be considered members of the Incumbent Board.

      "Committee" means the Board's Compensation Committee.

      "Corporate Transaction" means any of the following events: (i)
      Consummation of any merger or consolidation of the Company in which the
      Company is not the continuing or surviving corporation, or pursuant to
      which shares of the Common Stock are converted into cash, securities or
      other property, if following such merger or consolidation the holders of
      the Company's outstanding voting securities immediately prior to such
      merger or consolidation own less than a majority of the outstanding voting
      securities of the surviving corporation; (ii) Consummation of any sale,
      lease, exchange or other transfer in one transaction or a series of
      related transactions of all or substantially all of the Company's assets
      other than a transfer of the Company's assets to a majority-owned
      subsidiary corporation of the Company; or (iii) Approval by the holders of
      the Common Stock of any plan or proposal for the liquidation or
      dissolution of the Company.

      "Disability" means that the Optionee, at the time the notice of
      termination for disability is given to her by the Company, has been unable
      to perform the Optionee's essential duties under the Employment Agreement
      (after reasonable accommodations have been made for Optionee) for a period
      of not less than four consecutive months as a result of the Optionee's
      incapacity due to physical or mental illness. In the event that the
      Optionee resumes the performance of substantially all of the Optionee's
      duties under the Employment Agreement before the termination of the
      Optionee's employment for disability becomes effective, the notice of
      termination shall automatically be deemed to have been revoked.

      "Employment Agreement" means that certain employment agreement entered
      into by and between the Company and Optionee of even date herewith.

                                       6
<PAGE>

      "Qualifying Termination" means either that: (i) the Company terminates the
      Optionee's employment for any reason other than Cause, Disability or
      death; or (ii) the Optionee notifies the Company in writing that she will
      terminate her employment with the Company in response to a "Constructive
      Termination." Constructive Termination is defined as (a) a material
      reduction of the Optionee's duties, responsibilities, or authorities or a
      material adverse change in the prestige of Optionee's title, including
      without limitation, if the Optionee is required to report to any
      individual other than the Board, if the Optionee is not the highest
      ranking officer of the Company's ultimate parent entity or if Optionee is
      assigned material duties or material responsibilities that are not
      normally associated with the position of President and Chief Executive
      Officer of a company of similar size and market capitalization to the
      Company, (b) a reduction by the Company of the then current Base
      Compensation of the Optionee, (c) a relocation of the Company's
      headquarters of more than 35 miles from its location on the date hereof or
      a change in the Optionee's principal business location to a location other
      than the corporate headquarters, (d) a failure of the Board to nominate
      Optionee as a director of the Company; provided, however, that the
      replacement of Optionee as Chairman of the Board shall not constitute a
      Constructive Termination or (e) a breach by the Company of a material
      provision of this Agreement. If the Company cures such Constructive
      Termination within 10 days after its receipt of the Optionee's written
      notice, then Optionee will not be able to terminate her employment in a
      Qualifying Termination based on the event(s) in question. Each provision
      of this Agreement that provides for payments to be paid or material
      benefits to be provided to Optionee shall be deemed to be a material
      provision of this Agreement. If the Optionee does not give the Company
      notice that she will terminate her employment as a result of a
      Constructive Termination within sixty (60) days following the date she has
      actual knowledge of the material facts giving rise to the basis for such
      termination, the Optionee shall be deemed to have irrevocably waived the
      right to give notice on such basis unless the Company consents in writing
      to an extension of such period. For purposes of the foregoing waiver
      provision, the Company shall have the burden of proving actual knowledge
      of the Optionee of the material facts giving rise to the basis for such
      termination.

      "Release" means the Optionee's release and waiver of claims in the form
      required by the Employment Agreement.

                            [Signature Page Follows]

                                       7
<PAGE>

                                                     ONYX SOFTWARE CORPORATION

                                                     By:    /s/ Paul B. Dauber
                                                         -----------------------
                                                            Paul B. Dauber
                                                            Chief Legal Officer

                                       8
<PAGE>

If the following acknowledgment and acceptance is not executed within ten (10)
days of the effective date of this Option, it shall lapse and be treated for all
purposes as if it were never granted.

The Optionee acknowledges and represents that she is familiar with and
understands the terms and provisions of this Option. The Optionee hereby accepts
this Option subject to all the terms and provisions contained herein. The
Optionee hereby agrees to accept as binding, conclusive, and final all decisions
and interpretations of the Committee upon any questions arising under the
Option.

Dated:

WITNESS:                                                OPTIONEE:

                                                        /s/ Janice P. Anderson
---------------------------------                       ------------------------

                                       9