Topic
  • 8 replies
  • Latest Post - ‏2013-04-25T11:43:23Z by ATP_Events_User
SystemAdmin
SystemAdmin
95 Posts

Pinned topic Object array

‏2013-03-31T16:50:54Z |
Say I have a Business Object - Employee with fields as Name,Emp ID,Salary,Designation.On sending a department name as request,I get the list of all employees in that department.Based on Salary of each employee,I need to trigger an action as per the outcome of event rule.Assume there are 5 employees in the department.How do I iterate over each employee and decide whether to send an action or not ?
I get an event as below:How
<Employee>
<Name>Joe</Name>
<EmpID>001</EmpID>
<Salary>50000</Salary>
<Designation>Mgr</Designation>
<Employee>
.
.
.
<Employee>
<Name>John</Name>
<EmpID>005</EmpID>
<Salary>30000</Salary>
<Designation>Devlpr</Designation>
<Employee>
Updated on 2013-04-04T17:02:55Z at 2013-04-04T17:02:55Z by WBE
  • WBE
    WBE
    99 Posts

    Re: Object array

    ‏2013-04-02T15:34:46Z  
    Hi ATP_Events_User,

    I take it that you are really talking about are Event Objects rather than Business Objects. Does this page answer your question?
    http://pic.dhe.ibm.com/infocenter/dmanager/v8r0m1/index.jsp?topic=%2Fcom.ibm.wodm.dserver.events.dev%2Ftopics%2Ftsk_dse_processingmultipleinstances_eventandactionobjects.html&resultof%3D%2522%2565%2576%2565%256e%2574%2522%2520%2522%256f%2562%256a%2565%2563%2574%2522%2520%2522%2569%256e%2573%2574%2561%256e%2563%2565%2522%2520%2522%2569%256e%2573%2574%2561%256e%2563%2522%2520

    Regards
  • SystemAdmin
    SystemAdmin
    95 Posts

    Re: Object array

    ‏2013-04-03T17:44:52Z  
    Tried using the below link for evaluating conditions in the event rule but still was not able to get the outcome as desired.
    Event rule:if salary is more than 60000 and designation is "Mgr" then send details (send details is the name of the action)
    lets assume salary is more than 60000 and designation is mgr for 2 out of 5 people and rule should evaluate to true twice but in my case i see rule evaluates to true only once. how do i iterate over different employees ?

    http://pic.dhe.ibm.com/infocenter/dmanager/v8r0m1/index.jsp?topic=%2Fcom.ibm.wodm.dcenter.admin%2Ftopics%2Fwodm_dcenter_admin.html&resultof%3D%2522%2564%2565%2563%2569%2573%2569%256f%256e%2522%2520%2522%2564%2565%2563%2569%2573%2522%2520%2522%2563%2565%256e%2574%2565%2572%2522%2520
  • WBE
    WBE
    99 Posts

    Re: Object array

    ‏2013-04-03T18:17:44Z  
    I think you need to read this page: http://pic.dhe.ibm.com/infocenter/dmanager/v8r0m1/index.jsp?topic=%2Fcom.ibm.wodm.dserver.events.dev%2Ftopics%2Fcon_dse_businessobjectarrays.html&resultof%3D%2522%2565%2576%2565%256e%2574%2522%2520%2522%2561%2572%2572%2561%2579%2522%2520%2522%2561%2572%2572%2561%2569%2522%2520

    Regards
  • SystemAdmin
    SystemAdmin
    95 Posts

    Re: Object array

    ‏2013-04-04T16:58:09Z  
    Referred the same link related to Business Object Array but still not able to iterate.In business space under Filters I see my Event rule being displayed only once with value as true instead of dispayling event rule five time with values as True/False.
  • WBE
    WBE
    99 Posts

    Re: Object array

    ‏2013-04-04T17:02:55Z  
    Referred the same link related to Business Object Array but still not able to iterate.In business space under Filters I see my Event rule being displayed only once with value as true instead of dispayling event rule five time with values as True/False.
    Maybe I have misunderstood your requirement. The page is saying
    "For select any, if any instance meets the condition, then only instances in the array that meet the condition are passed to action objects." Is that not what you want? You don't need to code any iteration. "Select any" will do the trick for you.

    Regards
  • ATP_Events_User
    ATP_Events_User
    14 Posts

    Re: Object array

    ‏2013-04-19T06:49:33Z  
    • WBE
    • ‏2013-04-04T17:02:55Z
    Maybe I have misunderstood your requirement. The page is saying
    "For select any, if any instance meets the condition, then only instances in the array that meet the condition are passed to action objects." Is that not what you want? You don't need to code any iteration. "Select any" will do the trick for you.

    Regards

    I get an event with details of 3 employees and based on event rule which checks if salary is >5000 and designation is MGR ,I need to send an action separately for each employee satisfying the rule separately.But I observed that action is being sent with details of all the employees together satisfying the rule

    Below is teh event

    <connector-bundle name="EmpDetail" type="Event">
    <EmpRequest>
    <Designation type="String">MGR</Designation>
    <Salary type="Real">5500</Salary>
    <Name type="String">SM</Name>
    <ID type="Integer">1</ID>
    </EmpRequest>
    <EmpRequest>
    <Designation type="String">MGR</Designation>
    <Salary type="Real">6500</Salary>
    <Name type="String">SR</Name>
    <ID type="Integer">2</ID>
    </EmpRequest>
    <EmpRequest>
    <Designation type="String">TM</Designation>
    <Salary type="Real">4500</Salary>
    <Name type="String">KH</Name>
    <ID type="Integer">3</ID>
    </EmpRequest>
    </connector-bundle>
    </connector>

    Event Rule:

    ifselect any employee such that ( the salary of this employee is more than 5000 and

    the designation of this employee is "MGR" )

    thensend mgr detail ;

    Action :is as een below where in both the employee details are sent together instead of each employee being sent separately

    <connector-bundle id="6F38B6470A59E0A32E11E28F1C0A1B23" name="Send Mgr Detail" stream="1" type="Action" workflow="FACE">
    <Employee>
    <Designation type="String">MGR</Designation>
    <Salary type="Real">5500</Salary>
    <Name type="String">SM</Name>
    <ID type="Integer">1</ID>
    </Employee>
    <Employee>
    <Designation type="String">MGR</Designation>
    <Salary type="Real">6500</Salary>
    <Name type="String">SR</Name>
    <ID type="Integer">2</ID>
    </Employee>
    </connector-bundle>

    Also the Event Test Widget shows the Event rule only once instead of thrice and the action is shown once.

     

  • WBE
    WBE
    99 Posts

    Re: Object array

    ‏2013-04-25T07:40:50Z  

    I get an event with details of 3 employees and based on event rule which checks if salary is >5000 and designation is MGR ,I need to send an action separately for each employee satisfying the rule separately.But I observed that action is being sent with details of all the employees together satisfying the rule

    Below is teh event

    <connector-bundle name="EmpDetail" type="Event">
    <EmpRequest>
    <Designation type="String">MGR</Designation>
    <Salary type="Real">5500</Salary>
    <Name type="String">SM</Name>
    <ID type="Integer">1</ID>
    </EmpRequest>
    <EmpRequest>
    <Designation type="String">MGR</Designation>
    <Salary type="Real">6500</Salary>
    <Name type="String">SR</Name>
    <ID type="Integer">2</ID>
    </EmpRequest>
    <EmpRequest>
    <Designation type="String">TM</Designation>
    <Salary type="Real">4500</Salary>
    <Name type="String">KH</Name>
    <ID type="Integer">3</ID>
    </EmpRequest>
    </connector-bundle>
    </connector>

    Event Rule:

    ifselect any employee such that ( the salary of this employee is more than 5000 and

    the designation of this employee is "MGR" )

    thensend mgr detail ;

    Action :is as een below where in both the employee details are sent together instead of each employee being sent separately

    <connector-bundle id="6F38B6470A59E0A32E11E28F1C0A1B23" name="Send Mgr Detail" stream="1" type="Action" workflow="FACE">
    <Employee>
    <Designation type="String">MGR</Designation>
    <Salary type="Real">5500</Salary>
    <Name type="String">SM</Name>
    <ID type="Integer">1</ID>
    </Employee>
    <Employee>
    <Designation type="String">MGR</Designation>
    <Salary type="Real">6500</Salary>
    <Name type="String">SR</Name>
    <ID type="Integer">2</ID>
    </Employee>
    </connector-bundle>

    Also the Event Test Widget shows the Event rule only once instead of thrice and the action is shown once.

     

    You can make this to happen by doing 2 things:

    1. Set the maximum number of occurrences of the action object to 1 (defined on the action object editor page)

    2. Tick the "automatically generate multiple actions if the number of occurrences of an action object would exceed its maximum" option on the action editor.

    Regards

  • ATP_Events_User
    ATP_Events_User
    14 Posts

    Re: Object array

    ‏2013-04-25T11:43:23Z  
    • WBE
    • ‏2013-04-25T07:40:50Z

    You can make this to happen by doing 2 things:

    1. Set the maximum number of occurrences of the action object to 1 (defined on the action object editor page)

    2. Tick the "automatically generate multiple actions if the number of occurrences of an action object would exceed its maximum" option on the action editor.

    Regards

    It worked...Thanks !