Skip to main content

I have an InfoPath form integrated to a workflow.  I can open the form and successfully submit to the workflow and start an instance. 


It creates an InfoPath client activity that I can open in the K2 worklist. 


But when I try and submit the form I get the message ‘Some rules were not applied’ and the details are a SOAP error


‘The worklist item cannot be completed due to the following reason: Action not found.


 

The InfoPath client event is connected to a another InfoPath client event with a single line,  and under ‘Configure Outcomes’ I have used the default ‘Task Completed’.  But it is on the first client event that I get this error. 


Any suggestions?

The reason for this is that K2 needs to look at a field that holds the action value i.e. in the instance of an Approve/Decline event then K2 needs to look at a field carrying the result in order to determine what outcome line(s) to follow.



  1. Create a field in the InfoPath main data source to store the action e.g. ActionResult. Make the default value "Task Completed" i.e. the same value as the action on the activity.
  2. Run the InfoPath client event wizard and set the Task Action Field to the ActionResult XML field in the InfoPath XML structure and click next. Click "No" on the pop box to bind the field to a drop-down control.
  3. Click Finish.
  4. Redeploy.

Hi Charles,


I suspect something went wrong with your InfoPath template - sounds like a rule/action is not present.


I would recommend opening a formal support ticket.


Regards,


Ockert


I’m executing update and finish Actions from the object model(SourceCode.Workflow.Client) and from the k2 webpart, and it has worked fine.


But now I can’t get the list of actions associated to the worklist items through the object model. It’s the same code as before, I re-deployed my k2 project and nothing, removed  and created new reference for SourceCode.Workflow.Client and nothing. But in K2 webpart I can still see the actions and execute them.


 


WorklistItem owItem;


……..


……..       



foreach (Action oAction in owItem.Actions)  //-> Doesn't find actions! Why?


{}          


I’m executing update and finish Actions from the object model(SourceCode.Workflow.Client) and from the k2 webpart, and it has worked fine.


But now I can’t get the list of actions associated to the worklist items through the object model. It’s the same code as before, I re-deployed my k2 project and nothing, removed  and created new reference for SourceCode.Workflow.Client and nothing. I can still see and execute tha actions on the k2 webpart.



 


Code:


 


WorklistItem owItem;


……..


……..                     


            foreach (Action oAction in owItem.Actions)


            {


......


            }             


Where is this code you wrote residing?  In an web page, infopath form...?  Are you getting a compile time error or are the actions just not displaying at run time?


I have the same Infopath error: "Some rules were not applied".
The problem is in "K2 Action" because this use web service data connection.
Well, look in smartobject services (K2 Workspace ---> Management Console)  if exits a "Dynamic web services" service. If not exist add it and select in dropdown service this:


k2.backpearl.UKEU.ServiceObjects.DynamicWeb.ServiceBrokers.ServiceBroker


So... I added this services and after I don't receive any infopath error.  


 


I had this exact problem today, and fixed it by making sure that the K2 server connection I used to retrieve that worklistitem is under the respective activity destination users. I think it's because only the destination users have the permission to see the actions and act on them.

There are a few considerations to take into account when working with task actions whether it be in InfoPath/ASP/WinForm/[Other Forms Technology]:



  1. It is best practise to retrieve the list of actions from the K2 WorkList Item and build up a drop-down list, dynamic buttons, etc. This will ensure that the correct list is returned based on security rights. The security rights applied include:

  • The user has to be a destination user on the client event OR the client event must be set that anyone can action the task.
  • The Action Permission Rights, set via the K2 Workspace per action per activity per user, permits the correct users to view the actions. This is exclusive rights and therefore by default there is no permissions settings so that the destination users of the client event have access to all actions.
  • The form (any technology) has to use impersonation in order to pass the correct credentials to retrieve the action list.

With regards to InfoPath Client Events, it is easier to specify the Task Action Field so that K2 knows what InfoPath Form Field to check for the action value submitted. K2 will also automatically map the WebService call to retrieve the action list if you specify to bind the field to a drop-down list.
Caveat: If you do not set the Task Action Field, then you will need to manually add a rule in the InfoPath Form to set the Action under the _K2 XML node. If you have more than one action, you will also need to build a hard-coded action list in a drop-down list if you do not make use of the K2 WebService call. The latter is recommended as K2 will also apply permissions rights as mentioned in (1) above.

This is normally where the issues arrise as the Task Action Field is not correctly specified or the _K2 action field is not correctly set.

Hope this helps.


Just a thought about this thread.


I faced this problem with the 0807 blackpearl version in the specific following case:



  • I use 2 infopath processes pointing to the same document library (so I have only one InfoPath Form)
  • I have the issue when I'm in the infopath client events of the Child Process Instance

The reason is following, K2 updates the submit option of the infopath form (all submit rules starting with "Set Workflow Task Action")... and it didn't merge the submit rules needed for both processes. In my case, it only keep the one from the parent. To workaround, I've added some custom submit rules before the rule called "submit workflow" and after the last "Set Workflow...". I've created a custom rule for each Infopath Client event of the child process.


I hope this will help other people.


I ran into an issue like this as well although my resolution was a bit different.  I have a parent process and a child process both using a form with the same schema but being deployed to different form libraries.  The issue is that when the IPC occurs and the form data is copied the Connection String does not get updated to point to the proper process (still points to the parent) and any tasks in the child process actually use the Parent form template.  The tasks from the child process would not complete because of the "Action not found" error. 


The resolution in my case was to update the connection string field in the _k2 section of the infopath form to point to the child process and proper xml field name.  I also had to add a rule to the action field dropdown list to copy the selected action into the ActionName field in the _K2 section of the form for the task view in the Parent template.


Once I did this I was able to complete the task forms from the child process.


Hi,


Whenever you integrate a InfoPath with K2 Blackpearl workflow. Few data fields were added in InfoPath Form under folder _K2.


There is one field as ActionName under this _K2 folder. So Assign the Value of your action to this ActionName filed during submission of your form.


let’s say you have configured Approve and Reject to action at that activity. On Click of Submission button in InfoPath Assign the ActionName = Approve. It will take the action step in your workflow. We have faced the same issue in our Project. It’s working now. 


Regards


Parveen


 


I'll put a note in that I was having the same problem, and this turned out to solve it for me. 


I am using .aspx page to load the actions into a dropdown list (ddl). but the problem is that it does not load actions into ddl except only for the Admin account which is also set as Application pool identity in IIS.


Please help me in this regards. Thanks.


you need to configure your web app to do impersonation (web.config parameter), because in my understanding, you are always connected with the APP Pool user which is not good for doing K2 actions. :-)


 


Its working fine now with respect to my last post on this thread.


I checked the action rights in workspace. There was no entry at all which means anyone who has process rights can access the actions which is fine in my case. Then I enabled web app ASP.Net Impersonation from IIS which worked absolutely fine and is now letting me access to all the actions for any user i specify.


thanks :)


Reply