Rehosting the WF4 designer - how to save and execute workflows created through the rehosted designer - serialization

I'm looking for some clarity with regards to the use of Windows Workflow 4 in an integrated solution - specifically with regards to rehosting the designer and executing workflows created by eg. a business user.
Is the intention that the required custom activities are created and compiled into a dll, which is then deployed with the rehosted designer, allowing the business user to create/configure workflows that make use of these activities - the business user would then save the workflow as XAML, which can be stored in a location known to the application (database, filesystem etc.), and then when it is necessary for the application to execute a workflow, it can use XamlServices.Load to load the workflow from the specific location and execute it as a DynamicActivity?
How is the workflow saved so that it can later be reserialized with properties and other configuration values? I've tried deserializing a Xaml file saved out of the designer, and also using XamlServices.save().
Are there any potential issues here with using bookmarks/persistence?
As a related question, is there any easy way to "Go back" in a workflow, without defining return branches on every flowchart element? I'm looking at integrating a workflow with a UI for a user to enter responses, which the wf will process, and make decisions based on the input. Through the UI, the user should be able to "Go Back" to a previous input.

You can use the ActivityXamlServices.Load(path) to load a XAML file. It will return an Activity, actually a DynamicActivity, and you can use a WorkflowApplication to run it.
See my blog post for an exmple.

Related

Where to put database Model for extensions?

I want to write a small extension that is able to take some informations from the database, based on some user filter preference, and show them on the main page.
I have read: PHPBB extensions development and took a look at: ACME DEMO extension but i didn't find an answer to where the database handling should be placed. Normally this should go into a Model that will handle the data to a Controller, in this case I was not able to figure out where the Model should be placed in to the structure and how it should work.
How should an extension database model should be handled? Where should it sit in to the extension structure?
I'm guessing you would need an event listener.
PHP event listeners work with core events to inject code into phpBB.
Core events are like hooks, and they can be found throughout phpBB’s
codebase at key points. They give your extension access to phpBB’s
variables and allow you to use and modify them or to inject additional
PHP code during phpBB’s execution. -per the Skeleton Extension
Page

How to get Webtop Drl of a document via .net application?

Is it possible to retrieve drl ex:https://host:port /ewebtop/drl/objectId/0900a58e80970f7b of document via .net application?.So that when users clicks on this link they can be able to edit the document and when they close the document the document should be autosaved onto documentum.
First of all: a link is a link. What you decide to do with it I u to you. Default handler in browser will just redirect you to webtop application. If you have SSO you can have the document opened for edit. There are some extra arguments that can be provided (view/edit).
The object id is the only varying part of the URL, so you can easily construct this in code.
Secondly: what is your goal? There is no way to make the document upload itself into Documentum repo. You can write a plugin for every application to handle that, but it seems like a big task - especially dealing with security.
The problem is that upon check-in, user must provide some information - at least about the new version number...
If you're building a thick client in .net I would go with DFS - that's the only real option here.

How to retrieve Salesforce Page Layout Field Properties via API?

Context:
The Web interface coded in .NET (Grantee Portal for nonprofits applying for grants) is pulling information from the Salesforce Page Layout.
The Salesforce user we use to connect the Web interface with Salesforce via API has 'view all and edit all' rights
Issue:
As it is now, if a field is defined as Read-Only on the Page Layout in Salesforce, it is still editable on the web page (the Salesforce User we use has to have 'view all and edit all' rights)
What we are trying to achieve:
IF a field is defined as Read-Only on the Salesforce Page Layout
THEN the same field should be Read-Only on the Web interface page
Question:
To achieve the above, I guess that I need to fetch the field property for the Page Layout via API. Any ideas on how to do so?
Thank you!
Izumi.
You'll need Metadata API (the set of webservices that let you add new objects, fields, picklist values or even create classes & run unit tests).
Here's the API Guide: http://www.salesforce.com/us/developer/docs/api_meta/index.htm
Depending on how often you modify layouts you might decide "screw it, I'll just use Eclipse IDE". In that case you'd download all page layouts (they're XML files), point your C# app to them and let the magic happen.
Slightly more advanced is to use Migration Tool (Ant / Java based application that can be scripted for periodic download of same stuff).
Super advanced would be to use this API guide to write it in C#. It's not rocket science (here's the specification for Page Layout object and here's the Java sample code for the operation that retrieves the metadata... sorry, no C#). Actually you might be better off looking at this example though: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_describelayout.htm
Seeing that you'll probably want to cache this info somewhere anyway (I can't imagine your user coming to your page, having to wait for the webservice callout to complete, then having his UI rendered) - pick your poison.
Or share the work within the team (1 person kicks off with files downloaded with Eclipse, other tries to figure out the C# code to retrieve them on demand).

Approach for SharePoint file upload workflow

I'm working on a project that is basically a file upload "wizard" that basically does the following:
Entry form to select document library and enter some basic info.
Enter additional library-specific information.
Tie in some calendar events.
My goals are:
- Create this as a sandbox solution using Visual Studio
- Avoid hacks and reinventing existing functionality as much as possible.
Some SP features I have run across that might be useful:
- Content organizer feature.
- Association forms.
- Declarative workflows.
Possible approaches I've considered:
A content organizer library that kicks off a workflow on submission. Not sure what the user experience for this would be like. Really hoping to keep to a single link -> Next -> Next -> Done kind of approach.
A declarative workflow with custom actions containing all the complexity.
An association form in front of the built-in document upload form for each library with a follow-on association form for calendar events.
Is this feasible and if so which approach is simplest?
I think I've come to my own conclusions on this. I've decided to go with a Drop Off library as part of the Content Organizer built-in feature (#1 above). This appears to be the simplest approach so far since I can do the majority through configuration in the Entity.xml files of the features. Many of the other methods I tried seems like they would require functionality not available in a Sandbox solution.
In order to achieve this, I defined site columns and added them to custom Document Type, then added this Document Type to all libraries. Using the Drop Off library, I can define rules to move the file based on one of the fields in the custom Document Type. I'm hoping to do any follow-up steps as a workflow that kicks off on the Drop Off library when a file is uploaded or as an Associated Form.

how do you develop "create site" workflow in SP 2010

i want to try doing this directly in SP2010 designer first. I have never worked with workflow before and haven't found anything that really helped me out online.
Flow:
I go into a global team site. I fill out a form (predefined form i created with specific controls) and click submit (form is validated for input).
Workflow kicks starts sending an email to a user who is defined to approve this workflow.
Once approval is obtained, the workflow completes and creates a Team Site from the information in the initial Form I filled out.
I am sure this is simple for anyone who has been developing workflows, but again this is my first and my first time using SP2010.
Any help starting this would greatly be appreciated. I haven't really found any good examples online for something like this.
We just completed a project exactly like this. We made a list with all the fields necessary to create a site. We attached a custom Approval workflow created in SharePoint Designer and a Workflow Event Receiver. When the Approval workflow finished, the WorkflowCompleted event checked that the workflow outcome was Approved, retrieved the List Item associated to the Task, and passed that List Item to our builder class.