August 11, 2012

Flags for setValue methods

This entry is part of the Maximo Java Development series.

The Mbo class exposes a lot of setValue methods but we can categorize them in two big groups. The first group accepts only two arguments that are the name of the attribute to be set and its value. The second group of methods have three arguments that allows to pass an additional accessModifier flag.
The values that can be passed into this flag are defined in the MboConstants interface and Mbo class. The most important values are the following:
  • NOVALIDATION (1) - Suppress validation
  • NOACCESSCHECK (2) - Suppress access control checks
  • NOACTION (8) - Suppress action
  • NOVALIDATION_AND_NOACTION (9) - Suppress validation and action

Those values can be 'merged' using the Java bitwise OR operator "|". For example, if you want to suppress the validation and action you can use the NOVALIDATION|NOACTION constant.

4 comments:

  1. Can you explain an example for set sample value.

    ReplyDelete
    Replies
    1. If you have an Mbo that you want to set a field value without invoke validation method or action method you can use the follow code:

      [code]

      String value="descriptionvalue";
      Mbo currentMbo = (Mbo) mboSet.getMbo();

      -- currentMbo.setValue("DESCRIPTION", value, Mbo.NOVALIDATION);
      -- currentMbo.setValue("DESCRIPTION", value, Mbo.NOACTION);
      -- currentMbo.setValue("DESCRIPTION", value, Mbo.NOACCESSCHECK|Mbo.NOVALIDATION);
      -- currentMbo.setValue("DESCRIPTION", value, 8L);

      [/code]

      bye salman
      ciao Bruno

      Delete

    2. Tag: PM203A56. Let me share all of you about #5 Tips for Project Management Success,, I hope you enjoy it

      1. Plan your day using time management techniques

      As a project manager, time management skills are essential because you are dealing with a wide range of tasks that demand a quick turnaround time. Planning your day will go a long way in keeping you organized and increasing your productivity. Assist your task planning by using project management software which helps you track the work of you and your team.

      If you are not very tech savvy, a simple to-do list can also be a great organizational tool. Prioritize your most important tasks by putting them at the top of the list and less important ones at the bottom. Having a visual plan of your daily tasks helps to keep you on track and aware of time.

      Related post: Free ebook 104 secrets to become a great project manager

      2. Include stakeholders in important project conversations

      While you will have plenty of responsibilities regarding the project, don’t neglect your clients.

      Good communication is essential is keeping both parties informed of project progression, curtailing scope creep, and apprised of changing requirements. Some clients may have different expectations when it comes to communication, so make sure to establish the frequency and type of communication (like emails, phone calls, and face-to-face conversations) at the beginning of your project.

      Establishing communication expectations early helps alleviate stakeholder uncertainty about communication frequency and delivery.

      3. Regularly communicate with your team

      Daily team communication helps keep misunderstandings and unclear requirements under control. Keeping your team informed in every step of the project is essential to project management success.

      For example, a study published by Procedia Technology found that good communication skills were the cornerstone of project management. The study examined over 300 “construction project managers, architects, construction managers, engineers and quantity surveyors” and their successes and failures on various construction projects.

      4. Anticipate project setbacks

      Even the best-laid plans often go awry.

      Remember that even with a high amount of planning and attention to detail, your project may still encounter some challenges. Pay attention to complaints from stakeholders or colleagues, and other warning signs, like a missed deadline or cost overrun, that there may be a problem.

      Preventing a crisis will keep your project running smoothly, save you a lot of time, and keep you, your team, and your stakeholders confident in progressing with the project.

      Unfortunately not every complication can be avoided. Crisis management skills are essential for dealing with the unexpected. Project managers need to be flexible and pragmatic. Improvise and make sharp decisions when needed.

      Related post: 92 free project management templates

      5. Stay focused on the details

      A common problem project managers encounter is having the project aims not aligned with the organization’s objectives. A great project manager will strategize a plan for the project to lead back to the overall success of the business.

      Know your project’s scope by heart and avoid wandering outside of the project’s requirements. It’s too easy to get lost in minor details and forget what your focus is, so a well-planned project scope is essential for success.

      And final, you should use KPI to measure effectiveness of the project, here are full list: 76 project management KPIs


      Delete
  2. could you tell me if this code is ok or not .
    i want to initiate bill batch from work order application so i create a new custom class as


    /*
    * To change this license header, choose License Headers in Project Properties.
    * To change this template file, choose Tools | Templates
    * and open the template in the editor.
    */
    package cust.actions;

    import java.rmi.RemoteException;
    import java.util.Date;
    import java.util.Vector;
    import psdi.common.action.ActionCustomClass;
    import psdi.mbo.*;
    import psdi.util.MXException;
    import psdi.util.MaxType;

    /**
    *
    *
    */
    public class SampleAction implements ActionCustomClass {

    @Override
    public void applyCustomAction(MboRemote mr, Object[] os) throws MXException, RemoteException{
    //MaxType n= mr.getInitialValue("plusbillbatch");
    //MboSetIterator msr=null;
    int a;
    MboSetRemote mr2= mr.getMboSet("plusbillbatch");
    MboRemote bill= mr2.getMbo(0);
    String billno = bill.getString("billno");
    MaxType n= mr.getInitialValue("plusbillbatch");
    int b =Integer.getInteger("n");
    int c =Integer.getInteger("billno");
    c=b;
    MboSetRemote wo= mr.getMboSet("workorder");
    // mr2.setValue(string, 0);
    MboRemote won1 =wo.getMbo(0);
    String wno1 = won1.getString("WONUM");
    a=Integer.getInteger("won1");
    mr2.setValue("WONUM", a);



    }
    }

    ReplyDelete