Email templates

Hello All,

 Sorry for the long lag between posts. As you can imagine its been pretty crazy around here.

I ran into an issue that I thought I would post .

I had a customer upgrade from 5.5 to 7.1.1.14

End Users start a workflow for account creation which launch a manager approval
Manager Approval not getting generated . This means when you set a manual action in a customized WF it doesn't get created and throws back the error:


  Step complete 'Send Email'
              Step inactive 'start'
Deleting work item for action BackGround Submit
Deleting invalid work item #ID#41A93525105FB5A4:ECB3F1:1267ADC73D9:-7FE8
Finished executing workflow case WF_AC_RequestAccounts
'>
          </Message>
        </ResultItem>
      </WavesetResult>
    </ResultItem>
    <ResultItem type='error' status='error'>
      <ResultError throwable='java.lang.StringIndexOutOfBoundsException'>
        <Message>
          <Text>String index out of range: -1</Text>
        </Message>
        <StackTrace>java.lang.StringIndexOutOfBoundsException: String index out of range: -1&#xA;&#x9;at java.lang.String.charAt(String.java:444)&#xA;&#x9;at com.waveset.util.VariableExpander.expand(VariableExpander.java:119)&#xA;&#x9;at com.waveset.notification.EmailNotifier$Resolver.resolveReference(EmailNotifier.java:522)&#xA;&#x9;at com.waveset.notification.EmailNotifier$Resolver.resolveString(EmailNotifier.java:438)&#xA;&#x9;at com.waveset.notification.EmailNotifier.notify(EmailNotifier.java:858)&#xA;&#x9;at com.waveset.provision.WorkflowServices.notify(WorkflowServices.java:5260)&#xA;&#x9;at com.waveset.provision.WorkflowServices.call(WorkflowServices.java:816)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.callApplication(WorkflowEngine.java:4381)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.callAction(WorkflowEngine.java:4208)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.callAction(WorkflowEngine.java:3521)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.execute(WorkflowEngine.java:3361)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.makeTransition(WorkflowEngine.java:2901)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.checkExplicitTransitions(WorkflowEngine.java:2792)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.checkTransitions(WorkflowEngine.java:2578)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.processSteps(WorkflowEngine.java:1983)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1835)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1818)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1827)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1818)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1818)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1818)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.walkCases(WorkflowEngine.java:1743)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.execute(WorkflowEngine.java:861)&#xA;&#x9;at com.waveset.workflow.WorkflowEngine.execute(WorkflowEngine.java:505)&#xA;&#x9;at com.waveset.workflow.WorkflowExecutor.execute(WorkflowExecutor.java:256)&#xA;&#x9;at com.waveset.task.TaskThread.run(TaskThread.java:132)&#xA;</StackTrace>
      </ResultError>



 Action Remove Error Result
                  Result title set to 'Remove Error Result'
                  Evaluating XPRESS
                Action
                  Resolved reference userView.waveset.email = testuser@test.com
                  Argument op = notify
                  Argument template = ET_AC_RA_ApproverNotification
                  Argument to = 103013922
                  Argument catch = notificationException
                  Calling application 'com.waveset.provision.WorkflowServices'
                    Application requested argument op
                    Application requested argument type
                    Application requested all arguments
                    Application reference cc = null
                    Application reference port = null
                    Application reference localeLocator = null
                    Application reference locale = null
                    Application 'com.waveset.provision.WorkflowServices' threw an exception, terminating task.
                    Completing case 'WF_AC_RequestAccounts'
                    Case 'WF_AC_RequestAccounts' complete
                Step complete 'Send Email'

Steps I took:

So looking above I know the issue is with the email step.

Since the issue worked in production and not Dev. I had them compare the mail templates both which I thought were the same. One note this started working when copied over the prod templates but then stopped working. I had them check the mail server to make sure this box can reach it and it does fine. So I had another engineer look at it and we found that the subject line was different. Now about the issue above about the copying the one that worked over to development, I later found out that the customer changed the email template after it worked.



The solution was in one template the customer had the following:

<subject>

(Dev)Account  Approval request for $(worker.fullName) ($(worker.ssoID)).

</subject>



vs



<subject>

Account  Approval request for $(worker.fullName) ($(worker.ssoID)).

</subject>



As you can see the subject field in the email template has "(DEV)" at the start -- this causes a problem in the parsing logic, which results in an IndexOutOfBoundsException.

The bracket characters "(" and ")" are not a problem as such. The problem occurs when the left bracket is the first character in the subject line. The resolver class (which resolves variable definitions such as "$(foo)" into a value) tries to parse the "(" by walking left in the string -- but since it's the first character, a StringOutOfBounds exception is thrown.

It is a bug (19912 and 17229) both have been fixed as of 8.x



The point I would like to make is sometimes in IDM world it can be the simplest things that cause problems. It is always good to check and double check email templates and workflows for spelling errors or special characters. It also helps to have someone else check it as well.


Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

I have been in support for about 10 years now and have been doing IDM support for 5 years now. I have been working for SUN for 9 years and have supported the whole JES Stack during that time.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
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
   
       
Today