By user9156809 on May 19, 2010
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 126.96.36.199
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
<ResultItem type='error' status='error'>
<Text>String index out of range: -1</Text>
<StackTrace>java.lang.StringIndexOutOfBoundsException: String index out of range: -1
Action Remove Error Result
Result title set to 'Remove Error Result'
Resolved reference userView.waveset.email = firstname.lastname@example.org
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:
(Dev)Account Approval request for $(worker.fullName) ($(worker.ssoID)).
Account Approval request for $(worker.fullName) ($(worker.ssoID)).
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.