How to create a custom activity from NativeActivity and how to run it? - workflow-foundation-4

I am new to Workflows ,can any one suggest me good tutorials for Workflow foundation(with samples if possible).I have basic question on workflows how to create a custom activity using NativeActivity so that i can pass two input for it .

Related

Create record via client script in a relation model in App Maker

Could someone point me to documentation that shows how to create a record in a model with one to many relation via client side script.
Thanks in advance!
There are two ways of creating a new record.
1. Via a client-side script
You can do this by calling a createItem function from a widget. This link might help with that.
2. Via a server-side script
You can do this by directly creating a new record, assigning it to the relation of a model and then saving that model. This link might help with this method. By the way, it's easier to do this in a server-side script, as the guide itself says.
Since you just requested the link to official documentation, I've limited my answer to links only. Please feel free to ask if you need clarifications!

How to reuse parts of Windows Workflows?

I have 2 different WF workflows, which both use an identical piece of logic.
Currently that part is copypasted from one workflow to another.
How can I use a part of a workflow in two different workflows without duplicating it?
Basically, I want to have one "library" workflow, which is used by the 2 "real" workflows.
Just add a new "Activity Library" project to your solution.
Create an activity in the library that contains the common part.
Add a reference to the Activity Library project.
Build all in release.
Drop the common activity into your workflows.
You could make a new type of activity which is able to start a workflow definition.
So you end up with a workflow definition A, workflow definition B. And within this definitions you can place your custom activity which can execute a new workflow definition C.
So A and B points to C.
Workflow definition C can be defined as a child workflow of A and B.
I think this link is a good starting point.
http://wf.codeplex.com/wikipage?title=How%20do%20I%20invoke%20a%20Child%20Workflow%3f&referringTitle=Microsoft.Activities%20Overview
You can also just make a workflow with the common part and use LoadAndInvokeWorkflow activity to execute it in another workflow.

Tridion - Placing Item in Workflow from Event

Is it possible to place an item in workflow from the event system? The problem I am facing is that we would like to direct components to two different workflows based on what folder they are in (instead of what schema they use), which the Tridion UI doesn't seem to support. I was hoping to write an event that is triggered on check-in of a component, so I can then determine which folder that component is in and direct it into the appropriate workflow from the event.
I'm fine with creation of the event, I'm just totally lost on where to start as far as adding the item to workflow goes. I have looked at the TOM.NET API documentation but really haven't found anything that helps. Any assistance or examples would be appreciated.
As #Jeremy suggests, what you are actually trying to do is not possible.
However you can achieve the same outcome by making the second step of your workflow an automated decision which creates 2 separate workflow branches within one workflow process definition. Your automated decision can read the Org Item of the component and direct it accordingly.
This is not possible - a Component is only added to a WF process when it is saved and its Schema has an associated process definition.

How can I create a customized receive activity in WF?

I would like to create a WF receive activity but customized to use a fixed contract and fixed parameters. I have thought in extending the Receive activity and set some of it properties, but it is a sealed class.
Which is the best aproach to do that?
Your designer can use an IActivityTemplateFactory to pre-configure the existing Send/Receive with the contract you want. You can also add variables that may be required. That way developers won't have to type in each of the parameters.
You create a XAML activity and drop the Receive activity in there. If you add a service reference to a workflow project that is exactly what the tooling does when it generates the prepackaged activities for you.

How to build an iterative user-defined action in Visual Build Professional?

In VBP its possible to define user defined actions by creating a custom COM component or a custom script.
I need to create an user defined action which is iterative, which means it has to call child steps in an iterative manner like the "process files" built in action does.
I can't figure out how to do this and Google isn't helpful either.
Found the answer myself on the kinook forums:
Its not possible to define an iterative user-defined action, but its possible to use a workaround by defining a conditional build rule in the loop controlling step.

Resources