<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Burak BÖLEK - Blog &#187; Condition Class</title>
	<atom:link href="http://www.burakbolek.com/blog/tag/condition-class/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.burakbolek.com/blog</link>
	<description>Burak BÖLEK</description>
	<lastBuildDate>Fri, 03 Sep 2010 06:50:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Writing a Custom Condition Class</title>
		<link>http://www.burakbolek.com/blog/2009/03/writing-a-custom-condition-class/</link>
		<comments>http://www.burakbolek.com/blog/2009/03/writing-a-custom-condition-class/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 09:20:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Maximo Backend Development]]></category>
		<category><![CDATA[Maximo Tips]]></category>
		<category><![CDATA[Condition Class]]></category>
		<category><![CDATA[Maximo 7]]></category>

		<guid isPermaLink="false">http://www.burakbolek.com/blog/?p=48</guid>
		<description><![CDATA[One of the best improvements in Maximo 7.x is conditional user interfaces. You can create your conditions in Conditional Expression Manager application. But sometimes there are some issues that you can not write sql sentences. For these cases we can write our own condition class. We must extend psdi.common.condition.CustomCondition class to write the new class. [...]]]></description>
			<content:encoded><![CDATA[<p>One of the best improvements in Maximo 7.x is conditional user interfaces. You can create your conditions  in Conditional Expression Manager application. But sometimes there are some issues that you can not write sql sentences. For these cases we can write our own condition class. We must extend psdi.common.condition.CustomCondition class to write the new class. And we need to override  evaluateCondition(MboRemote mbo, Object arg1)  method. Here is an basic example..</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.custom.workorder</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.rmi.RemoteException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.mbo.*</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.common.condition.CustomCondition</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">psdi.util.*</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TipCondition <span style="color: #000000; font-weight: bold;">implements</span> CustomCondition <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> evaluateCondition<span style="color: #009900;">&#40;</span>MboRemote mbo, <span style="color: #003399;">Object</span> arg1<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> MXException, <span style="color: #003399;">RemoteException</span> <span style="color: #009900;">&#123;</span>
        newWORemote wo <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>newWORemote<span style="color: #009900;">&#41;</span> mbo<span style="color: #339933;">;</span>
 <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>wo.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ISSUETYPE&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;PROBLEM&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            psdi.<span style="color: #006633;">server</span>.<span style="color: #006633;">MXServer</span> mxs <span style="color: #339933;">=</span> psdi.<span style="color: #006633;">server</span>.<span style="color: #006633;">MXServer</span>.<span style="color: #006633;">getMXServer</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            MboSetRemote loc_set <span style="color: #339933;">=</span> mxs.<span style="color: #006633;">getMboSet</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;LOCATIONS&quot;</span>, wo.<span style="color: #006633;">getUserInfo</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            loc_set.<span style="color: #006633;">setWhere</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;location in('&quot;</span><span style="color: #339933;">+</span>wo.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CENTER1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #0000ff;">&quot;')&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            loc_set.<span style="color: #006633;">reset</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>loc_set.<span style="color: #006633;">count</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #003399;">String</span> kanal <span style="color: #339933;">=</span> loc_set.<span style="color: #006633;">getMbo</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CAPACITY&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>kanal.<span style="color: #006633;">startsWith</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;4&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
            <span style="color: #009900;">&#125;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> toWhereClause<span style="color: #009900;">&#40;</span><span style="color: #003399;">Object</span> arg0, MboSetRemote arg1<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> MXException, <span style="color: #003399;">RemoteException</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Have a good day&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.burakbolek.com/blog/2009/03/writing-a-custom-condition-class/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
