OIM Approval Workflow starting Exception

Hi to all. I'm working with approval workflow in OIM11g and I've followed the OBE for the design of a ResourceSerialApproval Workflow. When submitting a request which is to be approved by this workflow at request level, the request creation fails with this exception:
IAM-2050014:An error occurred while initiating approvals for request oracle.iam.platform.workflowservice.exception.IAMWorkflowException: Unable to instantiate the workflow process due to null. The corresponding error message is {1}.
I've searched this forum for the error and seen that maybe it could be caused by a bad props file when registering the workflow: this is NOT my case. The workflow gets correctly deployed.
Could anyone help me?
Please I have no idea on how to solve this problem.
Thanks in advance,
Giuseppe.

Hi,
Open your approval workflow in Jdev, open "ApprovalProcess.bpel" file in source mode,
Check if custom attribute is getting assigned before the payload is loaded:
something like
<copy>
<from variable="resourceAdmins"/>
<to variable="initiateTaskInput" part="payload"
query="/ns2:initiateTask/task:task/task:payload/task:ResourceAdministrators"/>
</copy>
<copy>
<from>
<payload xmlns="http://xmlns.oracle.com/bpel/workflow/task">
<RequestID xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
<RequestModel xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
<RequestTarget xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
<url xmlns="http://xmlns.oracle.com/bpel/workflow/task"/>
Regards,
Raghav.

Similar Messages

  • OIM Approval Workflow Scenario/Question

    Hello,
    Can anybody please explain how the approval workflow actually works in OIM?
    Scenario - After a user does self registration using the web console - how can we specify tasks in between that workflow - so that the user's manager should receive/approve the request first and then suppose then the request goes to some Department Head for his approval and then only the user will receive and confirmation email for logging into OIM.
    I understand the Provisioning workflow perfectly from OIM User Form to PRocess Form and from their to Target. But really want to understand this 'Approval/Self REgistration' workflow. Can anybody explain me with the steps that are needed to be configured in OIM Design Console for the 'scenario' explained above.
    Many Thanks!

    Hi,
    There is one possible solution for your requirement. I jsut the forget the name of the workflow which trigger while self registration.
    You can do one thing in that process add two task which assign task to manager and once he approved the request task will be assigned to deapartment head and once he approved the user will be created in OIM.
    Task will be assigned not as approval but as asisgned task, if its ok with you; just try this and let me know.
    Regards
    Alabhya Goel

  • OIM Approval Workflow

    Hi,
    I need to implement the following scenario in OIM.I have following 3 types of users in OIM . Employee,Organization Admin and Resource Admin.
    1.Organization Admin logs into OIM and request a resource to an user.While requesting,Organization admin needs to enter some information about the user (it could be either process form or resource form)
    2.Once the request is submitted,Resource Admin should see it in his pending task list.
    3.Resource admin approves the request and the user gets provisioned to the target system.
    I tried creating a process form,in which the admin can enter user details,but I am not sure how to attach approval workflow in that.
    When I tried using Resource Form,I am not able to populate user's information in the form.
    Any idea about how to implement this scenario?.Thanks in Advance.

    Hey Nitesh...
    Thanks for the Reply....
    Sorry i mistakenly put process form in place of object form. By default approver is only able to see only first name and last name in user details. What additional configuration i need to do so that approver can see the object form also for that user and then can approve/Reject. As the approver is from different organization so not able to view user details....but as per requirement have to show only the requested resource object form!
    Also i have couple of other questions which i am not able to crack....appreciate if you can help me to figure out the solution :)
    1. When i requested a resource for multiple users then approver is not able to approve it for few users and reject it for others under same request. Does OIM provide any kind of customization which can help me to achieve this.
    2. Once my user get provisioned in any resource lets say AD after that when i modified the user OIM profile and save it, it should modify the AD account also if the modified attribute is mapped in Resource form using prepopulate. Is this valid requirement?
    Edited by: user10781632 on Feb 26, 2009 5:35 AM

  • OIM approval workflow creation

    Hi Gurus,
    Is it possible to give permission to a group in the OIM to be able to create/manage Resource's approval workflow? If so, what I should do? Which permission are needed?
    Or just system administrator is able to do that?
    The group was created just to perform that activity and it can't have another privileges.
    I would appreciate any help.
    TiA,
    Carlos

    In pre 11g there is no really good way to do this as approval workflows are defined in the design console. One of the things I am excited about 11g is that the approval workflow is moved to BPEL (http://iamreflections.blogspot.com/2010/09/oim-11g-approval-workflow-orchestration.html)
    If you need to support this in pre 11g you can either try to configure the design console to just have the approval workflow menu item. i haven't tried that but it does not look simple or straightforward to me.
    If the approval workflows are simple you could try to go over the custom resource object or custom menu item road. A third option would perhaps be to let them define the workflows in a free standing tool and then parse in the changes and use the OIM API to update the approval workflows.
    Best regards
    /Martin

  • OIM , Approval WorkFlow Page Error

    Dear All,
    Kindly if anyone can share some experience on the following issue:
    1 - I have IDM 9.1.0.x
    2 - To define the approval workflow when I try to open the workflow designer i.e Manage Resources>Manage> select resource ... it shows error page with no error number just a link to IDM admin.
    My question is:
    1- Could it be due to some issue in connector of the relevant application (MySQL on backend> GTC with Java customized connector)?
    2- Or it could be a problem in the IDM system itself related to some configurations, missing installation components.
    what should I check to verify if it is some issue with the IDM servers settings?
    Thanks

    thanks for your reply,
    can you please be a little more elaborated and guide me how to remove this error, when click on the resource instead of opening workflow designer it opens a page with a link to admin, not showing any error just "A system error has encountered" message.
    thanks.

  • Defining Approver list in BPEL -OIM Approval Workflow

    Hi,
    We have a requirement where in we need to retrieve array of users from external resource (not integrated with OIM) and pass them as an approver list during resource provisioning request. As these users are not managed as a role in OIM, how do we achieve this functionality? We are retrieving these approvers as part of Java embedding in BPEL process, but not sure how to pass them as a approver list in BPEL -One of them can approve the request.
    Thanks in advance

    Thanks Kevin,
    So can I assign String DataType to the comma separated OIM Logins (approvers) and BPEL will take care of assigning them as approvers appropriately? If so, then will the request will be approved if one them approves it?
    Thanks again

  • Approval Workflow does not update the Content Approval status if started automatically

    Hi,
    I’m using a simple Approval Workflow associated with
    Content Approval on site pages. It works fine when I set it to be started manually (by using
    Allow this workflow to be manually started by an authenticated user with Edit Item permissions
     option) and on the completion of the workflow the
    Content Approval status is updated accordingly. But when I set it to be started automatically (by using
    Start this workflow when a new item is created
     / Start this workflow when an item is changed
    options), it does not updates the Content Approval status. Note that I’ve set the
    Update the approval status after the workflow is completed (use this workflow to control content approval)
    option to true.
    Regards

    Hello,
    It is recommended to select "Start this workflow to approve publishing a major version of an item" when you want to use the workflow to manage content approval for
    a library.
    According to the Notes for “Enable Content Approval” option in
    this reference:
    If you are using this Approval workflow to manage content approval (moderation) for a library, and you selected the Start this workflow to approve publishing a major version
    of an item check box on the Add a Workflow page..
    If you did not select the Start this workflow to approve publishing a major version of an item check box on the Add a Workflow page because you do not want this workflow to
    be the default content approval workflow for a library, you can select the Update the approval status (use this workflow to control content approval) check box to make this workflow a secondary content approval workflow that specific users can
    start manually.
    That means having an approval workflow start automatically when a document is changed or created is not a good practice when you want to use the workflow to manage
    content approval for a library. You should either select "Start this workflow to approve publishing a major version of an item" or give users the option to start the workflow manually at the time they want to submit for an approval.
    Thanks & Regards.
    Lily Wu

  • Approval Workflow deploy in Jdeveloper - SOA Server not showing up in list

    Trying to deploy an OIM approval workflow. Added my weblogic server, and tried to deploy. When it comes to selecting a SOA server, no soa servers show up in the list. Any ideas? Thanks.

    For sca deploy are you need to specify few other properties; are you putting those correctly?
    <ant antfile="${oracle.home}/bin/ant-sca-deploy.xml">
        <property name="serverURL" value="?" />
        <property name="sarLocation" value="?" />
        <property name="overwrite" value="?" />
        <property name="user" value="?" />
        <property name="password" value="?" />
        <property name="partition" value="?" />
    </ant>HTH,
    BB

  • Approval workflow of purchase requisitions after EhP4

    Hi all,
    After implementing a new support package installation (Ehp4), there are some purchase requisitions that get their approval workflow started again even after purchase order has been created.
    Is there someone that could give me some help on this topic?
    Thanks a lot.
    Sílvio Galery

    Hi,
    Please see note 797775    Entry in Transaction SWEC hinders workflow.
    1. Delete the entry 'EINKBELEG BUS2012 RELEASESTEPCREATED On Create'
    from SWEC.
    2. Activate the linkage between BUS2012 RELEASESTEPCREATED and
    WS20000075 in Txn SWE2.
    This will help you.
    Kind Regards,
    Suneet

  • Problem with custom sharepoint designer approval workflow - check box: 'Start this workflow to approve publishing a major version of an item' is greyed out

    I wanted to create a simple approval workflow. Hence I opted to start from scratch rather than copy the OOTB approval WF. Using SharePoint Designer (not Visual studio) I created a reusable workflow and have added the built in 'Start approval process' action.
    It's saved and published globally.
    Everything works fine except that when associating the WF with a list the 'Start this workflow to approve publishing a major version of an item' check box is disabled.
    Major and minor versioning is enabled for the library.
    What am I missing here? Or do I have to start from the OOTB approval WF to get this to work?
    Regards
    Henning

    Again - new ideas pop up right after defining the issue as a problem. :-) Problem solved!
    I solved this by creating a new workflow from the original publishing approval workflow (copy and replace), but instead of tweaking the already defined approval process (WF action) I deleted it, then deleted all initiation form and local variables,
    and then added the 'Start approval process' action again. This re-installs all the necessary local variables without any initiation form involvement, which is just what I want.
    From here I can tweak the workflow to make it more user friendly, much like
    described by Bobby Chiang in his great blog.
    Remember to add action Set Workflow Variable 'EnableContentApproval' to Yes right before the Start Approval Process action, else the document's status won't be set to 'Approved' or 'Rejected' as an output of the workflow.
    Learning every day!
    Henning

  • OIM 11g Approval Workflow - Error

    Hi All,
    I have created a approval workflow (Operational) in OIM11g. Have deployed it as a soa-composite and registered with OIM. Till here everything went fine.
    I have created an apporval policy, to assign to requests of a specific type of resource .
    When the resource is requested, the approval workflows is gettign triggered,but the request goes to failed state.
    I am getting any exceptions in the logs / on the console.
    Has anyone encountered this kind of issue.
    Vicky

    vicky wrote:
    Hi All,
    I have created a approval workflow (Operational) in OIM11g. Have deployed it as a soa-composite and registered with OIM. Till here everything went fine.
    I have created an apporval policy, to assign to requests of a specific type of resource .
    When the resource is requested, the approval workflows is gettign triggered,but the request goes to failed state.
    I am getting any exceptions in the logs / on the console.
    Has anyone encountered this kind of issue.
    VickyCheck your SOA server through the em and that should show you your request and the fault states and everything .. that should give you an idea on what is going wrong ...

  • Error - Complex Approval Workflow in OIM

    I am trying to configure a complex workflow in OIM.
    I have done the following steps to do this :
    1. Made the resource a self-requested resource.
    2. Created a provisioning task for this resource.
    3. Created an approval task with appropriate assignments.
    When I try to trigger this workflow, it works fine and the concerned approver gets the notification as well. But when the approver tries to act upon it(Approve/Reject),
    OIM throws the following exception :
    12:06:30,671 ERROR [SERVER] Class/Method: tcDataObj/eventPreUpdate Error :Data O
    bject Update Permission denied
    12:06:30,687 ERROR [APIS] Class/Method: tcProvisioningOperationsBean/updateTask
    encounter some problems: maoRejections:You do not have permission to update this
    object.
    12:06:30,687 ERROR [WEBAPP] Class/Method: ApprovalsAction/approveDenyTasks encou
    nter some problems: You do not have permission to update this object.
    Thor.API.Exceptions.tcAPIException: You do not have permission to update this ob
    ject.
    at com.thortech.xl.ejb.beansimpl.tcProvisioningOperationsBean.updateTask
    (Unknown Source)
    at com.thortech.xl.ejb.beansimpl.tcProvisioningOperationsBean.updateTask
    (Unknown Source)
    at com.thortech.xl.ejb.beans.tcProvisioningOperationsSession.updateTask(
    Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
    tatelessSessionContainer.java:214)
    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
    ke(CachedConnectionInterceptor.java:185)
    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
    elessSessionInstanceInterceptor.java:130)
    at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(Service
    EndpointInterceptor.java:51)
    at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation
    Interceptor.java:48)
    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
    rceptor.java:105)
    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
    torCMT.java:335)
    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
    66)
    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
    java:139)
    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
    at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
    ryFinderInterceptor.java:122)
    at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:6
    24)
    at org.jboss.ejb.Container.invoke(Container.java:873)
    at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
    er.java:141)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
    at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
    at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
    java:249)
    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
    at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(Loca
    lInvoker.java:155)
    at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
    at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerIntercepto
    r.java:179)
    at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav
    a:165)
    at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.
    java:46)
    at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:5
    5)
    at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessi
    onInterceptor.java:97)
    at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
    at $Proxy512.updateTask(Unknown Source)
    at Thor.API.Operations.tcProvisioningOperationsClient.updateTask(Unknown
    Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at Thor.API.Base.SecurityInvocationHandler$1.run(Unknown Source)
    at Thor.API.Security.LoginHandler.jbossLoginSession.runAs(Unknown Source
    at Thor.API.Base.SecurityInvocationHandler.invoke(Unknown Source)
    at $Proxy956.updateTask(Unknown Source)
    at com.thortech.xl.webclient.actions.ApprovalsAction.approveDenyTasks(Un
    known Source)
    at com.thortech.xl.webclient.actions.ApprovalsAction.confirmApprove(Unkn
    own Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
    java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchActio
    n.java:280)
    at org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatch
    Action.java:252)
    at com.thortech.xl.webclient.actions.tcActionBase.execute(Unknown Source
    at com.thortech.xl.webclient.actions.tcAction.execute(Unknown Source)
    at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
    tProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
    va:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
    2)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:173)
    at com.thortech.xl.webclient.security.SecurityFilter.doFilter(Unknown So
    urce)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:173)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
    lter.java:81)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
    icationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
    ilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:178)
    at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrinc
    ipalValve.java:39)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
    yAssociationValve.java:153)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
    e.java:59)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
    ava:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
    ve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
    a:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
    :856)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
    ssConnection(Http11Protocol.java:744)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
    int.java:527)
    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
    kerThread.java:112)
    at java.lang.Thread.run(Thread.java:53)
    I have faced the same problem before as well but unable to solve it. Please guide.

    ok so can you export your resource object with the deployment manager (check that all dependencies are exported) and mail me the xml file along with any jar file used by the adapters (avoid zip or rename it zippy) matthieu.valente_at_oracle.com
    I'll have a look at it on monday if I can

  • OIM 11g - Approval workflows for disabled user accounts

    Hi,
    We have a scenario wherein a user will be created in OIM with a future start date resulting in a Disabled Untill Start Date user status. Once the user is created, we should let anyone submit a New Hire form for the user and the submitted form needs to be approved by the Manager. Once the Manager approves the form, the target accounts should get created with disabled status. These accounts should get enabled on the start date.
    As submission of New Hire Form is not a straightforward process, we came up with the following design.
    A dummy resource object corresponding to the New Hire Form will be created and can be requested for a newly hired person by anyone who has OIM access. An approval workflow will be configured for the New Hire Form Resource object and provisioning of target accounts will be based on Manager's approval for this resource object.
    However the challenge that we see with this design is, it wasn't possible to place a request for New Hire Form dummy resource object for a disabled user. But the requirement is to complete the New Hire Form submission process befor the user becomes active.
    How can these workflows be invoked for a disbaled user? Is there any other way to implement this requirement?
    Any kind of help/guidance is greatly appreciated.
    Thanks and Regards
    Deepa

    911709 wrote:
    If I create a dummy resource, called "Group Membership" for example, and use this to show the groups that are available in AD, how can I have the request be routed to different approvers? For example, group cn=HR Users,cn=Users,dc=company,dc=com needs to be routed to HR for approval. Group cn=IT,cn=Users,dc=company,dc=com needs to be routed to IT for approval. How can I change the approvers dynamically?
    Re: Spawning multiple approval tasks in parallel in OIM11g SOA Composite
    You can have dynamic task assignment in BPEL; where you defne a variable in the task assignment and update the variable with the approver group name before triggering the task assignment task. Check BPEL docs for same.
    If every group needs a different approver, and there are 5000 groups, can I make 5000 resources and use the built-in routing of approvals? Or, use the dummy resource approach and handle the management of the approvals in some other way.Just make one resource with one field attached to it which takes in the group name and handle approval in SOA by reading a lookup which has AD group to Approval Group mapping.
    >
    Thank you.-Bikash
    Edited by: Bikash Bagaria on Feb 18, 2012 1:00 AM

  • Not able to start out of the box approval workflow programmatically

    We have a requirement to start an out of the box workflow from a .NET web service.
    We are using the StartWorfklow method:
    wfManager.StartWorkflow(item, association, association.AssociationData
    we are getting the below error message at the above line of code: Attempted to perform an unauthorized operation.. Data: System.Collections.ListDictionaryInternal
    Then, we tried:
    SPSecurity.RunWithElevatedPrivileges(delegate()
            wfManager.StartWorkflow(item, association, association.AssociationData,
    SPWorkflowRunOptions.Synchronous);
    Now, the workflow got canceled automatically with "Failed on Start" status. In the "Workflow History", it is showing 2 records with "was canceled by System Account." & "failed to start" in the description
    column.
    Please advise.

    Hi Zhengyu,
    1. I've already done that:
    a) when "SPSecurity.RunWithElevatedPrivileges(delegate()"
    is used, there are no errors showing up and code gets executed. However, the workflow failed to start.
    b) When I don't use elevated privileges, the code is showing an error (Attempted to perform an unauthorized operation.. Data: System.Collections.ListDictionaryInternal) when
    it tries to start the workflow (StartWorkflow method).
    2. The workflow starts with no issues through UI. I tried it using "System Account" and another account.
    3. I tried also "Collect Feedback" workflow template. Same results...
    You can find the code below:
    public
    stringStartItemWorkflow(stringsitePath,
    stringlibraryName,
    stringfileName)
    stringreturnVal =
    String.Empty;
    stringwfName =
    "VPApprovalWF";
    SPUserTokentoken = GetSecurityToken(sitePath);
    try
    using(Microsoft.SharePoint.SPSiteportalSite
    = newMicrosoft.SharePoint.SPSite(sitePath,
    token))
    using(SPWebportalWeb
    = portalSite.OpenWeb())
                        portalWeb.AllowUnsafeUpdates =
    true;
    SPListlist = portalWeb.Lists[libraryName];
    SPQueryfileQuery =
    newSPQuery();
                        fileQuery.Query =
    String.Format("<Where><Contains><FieldRef
    Name='FileLeafRef' /><Value Type=\"User\">{0}</Value></Contains></Where>", fileName);
                        fileQuery.ViewAttributes =
    "Scope='RecursiveAll'";
    SPListItemCollectionlistItemCol = list.GetItems(fileQuery);
    SPWorkflowManagerwfManager = portalSite.WorkflowManager;
    SPWorkflowAssociationCollectionassociationCollection
    = list.WorkflowAssociations;
    if(listItemCol.Count > 0)
    foreach(SPListItemitem
    inlistItemCol)
    if(associationCollection.Count > 0)
    foreach(SPWorkflowAssociationassociation
    inassociationCollection)
    if(association.Name == wfName)
                                            item.Update();
                                            association.AutoStartChange
    =
    true;
                                            association.AutoStartCreate
    =
    false;
                                            association.AssociationData
    =
    String.Empty;
                                            StartWF(wfManager,
    item, association);
                                            returnVal +=
    "Workflow Started";
    break;
    else
                                    returnVal +=
    "No workflows are attached to the library.";
    else
                            returnVal +=
    "A file with the name provided doesn't exist";
                        portalWeb.AllowUnsafeUpdates =
    false;
    catch(Exceptionex)
                returnVal +=
    "Workflow not started, reason: "+
    String.Format("Source:
    {0}. Stack Trace: {1}. Inner Exception:{2}. Message: {3}. Data: {4}", ex.Source, ex.StackTrace, ex.InnerException, ex.Message, ex.Data);
    returnreturnVal;
    SPUserTokenGetSecurityToken(stringsitePath)
    SPUserTokentoken =
    null;
    SPSecurity.RunWithElevatedPrivileges(delegate()
                Microsoft.SharePoint.
    SPSiteportalSite =
    newMicrosoft.SharePoint.SPSite(sitePath);
                token = portalSite.RootWeb.EnsureUser(
    "DOMAIN\\ADMIN-USER").UserToken;
                portalSite.Dispose();
    returntoken;
    privatestaticvoidStartWF(SPWorkflowManagerwfManager,
    SPListItemitem,
    SPWorkflowAssociationassociation)
    SPSecurity.RunWithElevatedPrivileges(delegate()
                wfManager.StartWorkflow(item, association, association.AssociationData,
    SPWorkflowRunOptions.Synchronous);
    Thank you all for your help.
    Regards,

  • Out of the box approval workflow suddenly failed on start (retrying)

    SharePoint 2010. I've been using out of the box approval workflow for several month now. I did some minor changes to it, like to who and when emails should be send, but that's all.
    Then out of a sudden it stopped working. New request status is "Failed on start (retrying)". Sometimes (!) status is "In Progress", but no tasks are created. In both cases there is nothing on workflow history and error report is also empty
    (it even cause an error "Report contains no data").
    I'm sure that I didn't change anything in a workflow. The only think that I changed was an InfoPath form, but I only added there field "Created By", so I would see in calendar later who created this request. I couldn't see how this might affect workflow
    process.
    I'm confused as I don't even know where to start searching for the solution. Why this might happen? Any ideas are very welcome!

     In my list I have a multiple choice field which is not required. When it was
    blank my workflow was failing on start! This field was not involved in a workflow directly, I included it only in the email to approver. When I deleted it from an email everything was fine.

Maybe you are looking for