Hi all,
Please suggest me when i am creating new form i have to attach workflow to that form.How can i do that I have created form using form builders with some fields and i am creating the form using web top.
Any one can help me how to do this.
Create a forms processor adaptor (see Forms Builder Developer Guide) and in that code, you can launch workflow with this form attached.
Hi johnny,
I am new to form builder.As you said I created a button in form and wrote an adoptor class by implenting IDocbaseDocumentProcessor.After that how to get the form object ? because While creating the form from webtop before it gets created I am clicking the submit button.will it attach that form to workflow.if not how can I achieve this as soon as the form is created it has to attach to the work flow please help me by providing some sample code.
Check for the invoke action button in forms builder. On click of button write code to launch a workflow ad attach the form as package. My only doubt is, while creating invoke button, one needs to specify the application name. It works fine with Taskspace, not sure about Webtop.
Another solution is write a document validator adaptor and override the Validate method. In that write the logic to launch workflow. When the form is submitted and all the required data fileds are entered, the adaptor will be executed.
Can any one provide me the sample code or a link.In adoptors, can I use DFC code and how can I get the form object.Because I have to get the values from form attributes and move form to a particular folder based on the attributes.
I would use Document Processor instead of Document Validator. Read the Forms Builder Development guide for samples of adaptor code.
You are right document processor can also be used, but one can also Document validator. I did it in one my previous assignments. Reason why I am saying is Document validator also executes after the form is submitted and in the validate method it takes Document Object as the input parameter. So when the form is submitted, one can fetch the form attributes and can perform various things as needed.
crimsonnav You can get the sample code in forms builder development guide. I can briefly tell you the way to fetch form attributes
public boolean validate(Document document) throws XFormsProcessorException {
JXPathContext validateContext = JXPathContext.newContext(document);
validateContext.getPointer (your form attribute which is nothing but the data binding value in forms builder.
Hope it helps