1 2 Previous Next 16 Replies Latest reply: Feb 6, 2013 2:58 AM by user1175496 RSS

    Throwing exception from criteria workflow

    user1175496
      Hi,
      I have a criteria workflow which executes a custom service for downloading the file in a network folder,the criteria workflow has 0 reviewers.Now i want to throw an exception if the downloading fails.This criteria workflow is created as business wants to keep it flippable ,i.e.in near future they might want to add reviewers to this workflow,Is there a way to throw an error as soon as the user submits the request or after it fails.
        • 1. Re: Throwing exception from criteria workflow
          Jiri.Machotka-Oracle
          Why don't you simply throw an exception from your custom service?

          IMHO this should belong to the code executing the download, not the workflow calling the service.
          • 2. Re: Throwing exception from criteria workflow
            user1175496
            I'm throwing the exception from the service-!csUnableExecuteService(DOWNLOAD_DOCUMENT),but how do i show that exception to the end user.I'm using follwoing piece of code in my resource file:
            <tr>
                 <td>DOWNLOAD_DOCUMENT</td>
                 <td>DocService
                      63
                      null
                      null
                      documents<br>
                      !csUnableExecuteService(DOWNLOAD_DOCUMENT)</td>
                 <td>3:downloadDocument:::!csUnableToExecuteAction(downloadDocument)</td>
            </tr>
            • 3. Re: Throwing exception from criteria workflow
              Jiri.Machotka-Oracle
              Ok. So, the question really is about displaying the exception text than throwing the exception.

              From your previous post I assume that the service is called from a workflow step, most likely in the Entry event via ExecuteService idocScript command. If so, you may use the return parameter Status to validate, whether service call succeeded, or failed. Now, you also mentioned that there are no reviewers - to Whom do you want to display the error, then?

              Being in a workflow, you may send a notification email, via wfNotify, or store the Status into a workflow variable and display an error in the following step.
              • 4. Re: Throwing exception from criteria workflow
                user1175496
                jiri.machotka wrote:
                Ok. So, the question really is about displaying the exception text than throwing the exception.

                From your previous post I assume that the service is called from a workflow step, most likely in the Entry event via ExecuteService idocScript command. If so, you may use the return parameter Status to validate, whether service call succeeded, or failed. Now, you also mentioned that there are no reviewers - to Whom do you want to display the error, then?

                Being in a workflow, you may send a notification email, via wfNotify, or store the Status into a workflow variable and display an error in the following step.
                How do i get the status of the service executed,based upon that i can send out email notification to the author,I'm trying to send out mail to the author from the workflow,but by default the email is being sent to the approver.
                • 5. Re: Throwing exception from criteria workflow
                  Jiri.Machotka-Oracle
                  It's described in the manual for IdocScript. Search for executeService and wfNotify. I can send you direct links, but only in a couple of hours.
                  • 6. Re: Throwing exception from criteria workflow
                    user1175496
                    jiri.machotka wrote:
                    It's described in the manual for IdocScript. Search for executeService and wfNotify. I can send you direct links, but only in a couple of hours.
                    I'm able to send with the issue that it is being sent to Appprover and not to the author :-(.
                    I will try and get the status code using the Idoc.
                    • 7. Re: Throwing exception from criteria workflow
                      user1175496
                      Tried with the following piece of code ,But its throwing the below mentioned error:
                      <$executeService("DOWNLOAD_DOCUMENT")$>
                      <$status=<$StatusCode$>$>
                      <$trace ( "<$StatusCode$>", "#console")$>
                      <$if status == 0 $>
                      <$wfMailSubject="<message>"$>
                      <$wfMessage="<message> <$dDocName$>"$>
                      <$wfNotify(dDocAuthor,"user")$>
                      <$elseif status == -1 $>
                      <$wfMailSubject="<failure message>"$>
                      <$wfMessage="< failure message> <$dDocName$>"$>
                      <$wfNotify(dDocAuthor,"user")$>
                      <$endif$>


                      evaluateScript: error evaluating exit script.
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     !csWfScriptEvalError,exit,RequestReview,RequestWorkflow!csDynHTMLArgumentMessage1,3,28,<$executeService("DOWNLOAD_DOCUMENT")$>
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     <$status = <$StatusCode$>$>
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     <$trace ( "<$StatusCode$>"\, "#0023console")$>
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     <$if status == 0 $>
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     <$wfMailSubject ="<message>" $>
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     <$wfMessage ="<message><$dDocName$>$>
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     <$wfNotify(dDocAuthor\,"user")$>
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     <$elseif status \== -1 $>
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     <$wfMailSubject="<failure message>"$>
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     <$wfMessage="<failure message> <$dDocName$> "$>
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     <$wfNotify(dDocAuthor\,"user")$>
                      (internal)/3     02.01 05:34:50.852     IdcServer-2906     <$endif$>!csParserUnableToFindClosingElement,\s

                      Edited by: user1175496 on Feb 1, 2013 5:24 AM
                      • 8. Re: Throwing exception from criteria workflow
                        Jiri.Machotka-Oracle
                        <$status=StatusCode$>
                        should fix it. Note that you can use also StatusMessage to return more - see http://docs.oracle.com/cd/E23943_01/doc.1111/e10726/c06_core_ref.htm#i1282954 and below
                        • 9. Re: Throwing exception from criteria workflow
                          user1175496
                          jiri.machotka wrote:
                          <$status=StatusCode$>
                          should fix it. Note that you can use also StatusMessage to return more - see http://docs.oracle.com/cd/E23943_01/doc.1111/e10726/c06_core_ref.htm#i1282954 and below
                          >
                          <$status=StatusCode$>
                          should fix it. Note that you can use also StatusMessage to return more - see http://docs.oracle.com/cd/E23943_01/doc.1111/e10726/c06_core_ref.htm#i1282954 and below
                          Updated and tried but now its another error,and i'm not even able to find anything on google:
                          (internal)/3     02.01 07:47:26.151     IdcServer-3953     !csWfScriptEvalError,exit,TranslationRequestReview,SPRTranslationRequestWorkflow!csDynHTMLArgumentMessage1,5,9,<$executeService("DOWNLOAD_DOCUMENT")$>
                          (internal)/3     02.01 07:47:26.151     IdcServer-3953     <$status = StatusCode $>
                          (internal)/3     02.01 07:47:26.151     IdcServer-3953     
                          (internal)/3     02.01 07:47:26.151     IdcServer-3953     <$trace ( "status"\, "#0023console")$>
                          (internal)/3     02.01 07:47:26.151     IdcServer-3953     <$if status == 0 $>
                          (internal)/3     02.01 07:47:26.151     IdcServer-3953     <$wfMailSubject ="<failure message>" $>
                          (internal)/3     02.01 07:47:26.151     IdcServer-3953     <$wfMessage ="<failure message>$>
                          (internal)/3     02.01 07:47:26.151     IdcServer-3953     <$wfNotify(dDocAuthor\,"user")$>
                          (internal)/3     02.01 07:47:26.151     IdcServer-3953     <$elseif status \!= 0 $>
                          (internal)/3     02.01 07:47:26.151     IdcServer-3953     <$wfMailSubject="<failure message>"$>
                          (internal)/3     02.01 07:47:26.151     IdcServer-3953     <$wfMessage="<failure message>"$>
                          (internal)/3     02.01 07:47:26.151     IdcServer-3953     <$wfNotify(dDocAuthor\,"user")$>
                          (internal)/3     02.01 07:47:26.151     IdcServer-3953     <$endif$>!csGrammarParserNoEndBrace
                          • 10. Re: Throwing exception from criteria workflow
                            Jiri.Machotka-Oracle
                            Actually (I should have noticed that myself), the error is related to executeService, not to StatusCode.

                            Can you remove or comment everything behind the executeService command to verify that you get the same error?

                            It looks as if the service requires some parameters. Can you share how you executed the service earlier?
                            • 11. Re: Throwing exception from criteria workflow
                              user1175496
                              I was earlier executing the service using following piece of code ,I started getting exceptions only after including the status part of it :-(

                              <$executeService("DOWNLOAD_DOCUMENT")$>
                              it was easily downloading the document in the local folder.
                              • 12. Re: Throwing exception from criteria workflow
                                Bunty
                                can you change your code to
                                <$executeService("DOWNLOAD_DOCUMENT")$>
                                <$trace("DOWNLOAD_DOCUMENT " & StatusCode,"#console","system")$>
                                enable system in trace sections and observe the value for StatusCode.
                                • 13. Re: Throwing exception from criteria workflow
                                  William Phelps
                                  The code is missing a close quote in the statements.
                                  (internal)/3 02.01 07:47:26.151 IdcServer-3953 <$wfMessage ="<failure message>$>
                                  (internal)/3 02.01 05:34:50.852 IdcServer-2906 <$wfMessage ="<message><$dDocName$>$>
                                  Edit to read
                                  <$wfMessage ="<failure message>"$>
                                  <$wfMessage ="<message><$dDocName$>"$>
                                  • 14. Re: Throwing exception from criteria workflow
                                    user1175496
                                    Hi,
                                    I modified the code but i'm still getting the following error in the logs,i'm not able to figure out what's wrong in the code,even when i try to comment the code that is getting executed at the back end of the service,but still it is throwing the following error:

                                    02.04 00:10:36.087     IdcServer-10324     evaluateScript: error evaluating exit script.
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     !csWfScriptEvalError,exit,RequestReview,RequestWorkflow!csDynHTMLArgumentMessage1,5,10,<$executeService("DOWNLOAD_DOCUMENT")$>
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     <$status = StatusCode $>
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     <$message = StatusMessage$>
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     <$trace ( "message"\, "#0023console")$>
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     <$trace ("DOWNLOAD_DOCUMENT" & StatusCode\, "#0023console"\,"system")$>
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     <$if status == 0 $>
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     <$wfMailSubject ="Your request has been submitted" $>
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     <$wfMessage ="Your request has been submitted "$>
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     <$wfNotify(dDocAuthor\,"user")$>
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     <$elseif status \!= 0 $>
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     <$wfMailSubject="Your request has been rejected"$>
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     <$wfMessage="Your request has been rejected.Please resubmit your request."$>
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     <$wfNotify(dDocAuthor\,"user")$>
                                    (internal)/3     02.04 00:10:36.087     IdcServer-10324     <$endif$>!csGrammarParserNoEndBrace
                                    1 2 Previous Next