Initiate Workflow With Smartobject

  • 4 August 2015
  • 7 replies
  • 3 views

Badge +6

Good morning

 

Can i initiate a workflow after a row is created in a smartobject?

 

Please, let me know the steps to do it

 

Thank you very much

 

Juan Antonio


7 replies

Userlevel 5
Badge +16

Hi,

 

can you explain more? where are you using your smartobject?

Badge +6

I am using an external application that updates a table related with an smartobject

 

Then, the issue is, when a new registry is created in this table (smartobject) i need to start a workflow

 

Thank you very much

 

Juan Antonio

Userlevel 5
Badge +16

Hi,

 

You will need an app to keep checking the database in a period of time and if there's new row a new instance will be started

 

I guess this would help with some modification to check your table

 

http://community.k2.com/t5/K2-blackpearl/how-to-start-workflow-automatically-daily-at-a-perticular-time/m-p/71546#M20549

Badge +10

Hi,

 

Yes it is possible.

You can do it as part of the smartobject method call, but it only works with workflows designed in K2 Studio or K2 for Visual Studio.

In the properties of the workflow (right-click a blank area in the canvas > Properties) go to the Association details (2nd last, icon on the left).

Check the check box to Create Workflow Smartobjects.

This will now create methods that can be used to start this workflow.

Save and deploy your workflow.

 

Now edit the smartobject which should start the workflow.

Edit the SmartObject method which should start the workflow.

Switch it to advanced mode if it isn't already, and edit the specific method.

Add a new method call after your record has been created.

Browse to the Workflow service instance and look for the Start Workflow action for your workflow and bind it accordingly.

Save and Test.

 

This is very high level, but hopfully will get you on the right track.

 

Regards,

JohanL

 

Badge +6

Thank you for your anwer, fantastic explanation!!!

 

Then, is only allowed in K2 Studio?, in K2 Designer is not allowed?,

Basically, so far I've only worked with the designer, and I have experience with studio

 

Thank you

 

Juan Antonio

 

 

Badge +10

Yes, that is correct, workflows designed through the K2 Designer does not have this option exposed.

Badge

Hi, Johan!
could you please your solution explain step by step, 'cause i didn't get result.
when i binded my SO to workflow for start workflow action , at the deploy moment error fire, that didn't find smartobject .
please if you can resolve your solution step by step it will be appriciate .
thanks in advance .

Regards,

Ali.

Reply