Announcement

Collapse
No announcement yet.

Domain Query

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Domain Query

    Hi ,

    Can anyone explain me the usage of "Domain Query" in Automation Agent.
    It would be great if you can provide me a simple example on the same.

    Regards,
    njoyotm

  • #2
    Re: Domain Query

    An agent, generally speaking, has to sit in the Domain of the Business Object it is executing against.

    EG Order Release Agent in SHIP/CUST domain, executes against Order Release SHIP/CUST.1234.

    The Domain Query lets you run the agent as if it were in another Domain.

    EG. Agent runs AS SHIP/BUY. This would allow you to execute AUTO-PLAN from within the SHIP/CUST agent domain, to create a Buy Shipment in the SHIP/BUY domain.


    To get the DOMAIN Query in the above example to work, you need the SAVED_QUERY with the following SQL Script...

    SELECT 'SHIP/BUY' FROM ORDER_RELEASE
    WHERE ORDER_RELEASE_GID = ?

    Hope this helps.

    Regards
    James Foran
    Toll Global Information Services
    http://www.tollgroup.com

    Comment


    • #3
      Re: Domain Query

      Hi James,

      Million Thanks to you.
      I tried it out and it worked fine without any issues.
      Thanks again.

      Regards,
      njoyotm

      Comment


      • #4
        Re: Domain Query

        Hi,

        I am using the query stated in this post in OTM 6.2

        SELECT 'parent_domain' FROM ORDER_RELEASE WHERE ORDER_RELEASE_GID = '$GID'

        but it is throwing the following error. What could be the possible issue with this configuration.

        java.sql.SQLException: Invalid column indexjava.sql.SQLException: Invalid column index at oracle.jdbc.driver.SQLStateMapping.newSQLException (SQLStateMapping.java:70) at oracle.jdbc.driver.DatabaseError.newSQLException(D atabaseError.java:133) at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:199) at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:263) at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:271) at oracle.jdbc.driver.DatabaseError.throwSqlException (DatabaseError.java:445) at oracle.jdbc.driver.OraclePreparedStatement.setStri ngInternal(OraclePreparedStatement.java:5012) at oracle.jdbc.driver.OraclePreparedStatement.setObje ctCritical(OraclePreparedStatement.java:7615) at oracle.jdbc.driver.OraclePreparedStatement.setObje ctInternal(OraclePreparedStatement.java:7555) at oracle.jdbc.driver.OraclePreparedStatement.setObje ctInternal(OraclePreparedStatement.java:8212) at oracle.jdbc.driver.OraclePreparedStatement.setObje ct(OraclePreparedStatement.java:8193) at oracle.jdbc.driver.OraclePreparedStatementWrapper. setObject(OraclePreparedStatementWrapper.java:230) at weblogic.jdbc.wrapper.PreparedStatement.setObject( PreparedStatement.java:357) at glog.util.jdbc.noserver.SqlPreparedStatement.setOb ject(SqlPreparedStatement.java:73) at glog.util.jdbc.noserver.SqlColumn$Converter.bindTo DB(SqlColumn.java:133) at glog.util.jdbc.noserver.SqlColumn.bindToDB(SqlColu mn.java:61) at glog.util.jdbc.noserver.SqlQuery.resetArguments(Sq lQuery.java:135) at glog.util.jdbc.noserver.SqlQuery.open(SqlQuery.jav a:106) at glog.server.workflow.SavedQuerySql.runSqlCheckOne( SavedQuerySql.java:249) at glog.server.workflow.SavedQuerySql.fetch(SavedQuer ySql.java:167) at glog.server.workflow.SavedQueryExecutor.fetch(Save dQueryExecutor.java:90) at glog.database.security.SecurityRunAs.evaluateDomai n(SecurityRunAs.java:61) at glog.database.security.SecurityRunAs.impersonate(S ecurityRunAs.java:84) at glog.server.agent.AgentWorkflow.execute(AgentWorkf low.java:77) at glog.server.workflow.WorkflowSessionBean.execute(W orkflowSessionBean.java:64) at glog.server.workflow.WorkflowSessionServerSideEJBW rapper.execute(WorkflowSessionServerSideEJBWrapper .java:3 at glog.server.workflow.WorkflowSessionServerSideEJBW rapper_61kh96_EOImpl.execute(WorkflowSessionServer SideEJBWrapper_61kh96_EOImpl.java:350) at glog.server.workflow.WorkflowManager.execute(Workf lowManager.java:352) at glog.server.workflow.Trigger.trigger(Trigger.java: 122) at glog.util.event.MemoryEventQueueRunnable.processEv ent(MemoryEventQueueRunnable.java:146) at glog.util.event.MemoryEventQueueRunnable.run(Memor yEventQueueRunnable.java:9 at glog.util.event.EventThread.run(EventThread.java:8 2) at java.lang.Thread.run(Thread.java:619) [lifetime - 4]java.sql.SQLException: Invalid column index

        Comment


        • #5
          Re: Domain Query

          The field parent_domain doesn't exist in the order_release record. Check out the data dictionary.

          Comment


          • #6
            Re: Domain Query

            Hi lourens,

            Sorry for not being very clear, when i say parent_domain, I actually meant parent domain of the subdomain in which the query exists. so suppose order release is in xxx/yyy domain then in the domain query, i am assigning the saved query as

            select 'xxx' from order_release where order_release_gid = '$gid'.

            I am selecting RUN AS "OBJECT" in the agent.

            and then when the agent is triggered it, throws the error

            java.sql.SQLException: Invalid column


            My requirement is to update the shipment in parent domain from agent triggered by the order release in subdomain.

            Comment


            • #7
              Re: Domain Query

              It can be me, but if I read the sql I think your error is in the '$gid'. It should only be $gid (so without the ').

              Obviously the 'xxx' should return a domain that is existing.
              Best Regards,

              Bob Romijn

              Comment


              • #8
                Re: Domain Query

                we need to use ? instead of $gid and it worked.

                Comment


                • #9
                  Re: Domain Query

                  I believe that $gid will also work, but at least without the quotes. But ? will work in this situation too.
                  Best Regards,

                  Bob Romijn

                  Comment

                  Working...
                  X