Workflow - Component - Developer Guide - Project Properties

Published on Wednesday, 9 November 2016

In this Article I'm going to explain how to create a Project Property and add it to the Project when a Component is added into Workflow.

Inspiration from the following Active Directory Library

LogicBase.Components.ActiveDirectory.dll
namespace LogicBase.Components.ActiveDirectory
public class TaskListTaskSource

WorkflowProjectProperties

Get the Property

string propertyValue = CurrentProjectHolder.GetInstance().Project.ProjectSetupData.FindProperty("PROPERTYNAME").PropertyValue;

AbstractOrchestrationProject project = CurrentProjectHolder.GetInstance().Project;
string propertyValue = project.ProjectSetupData.FindProperty("PROPERTYNAME").PropertyValue;

Set the Property

if (DesignMode.IsInDesignMode && CurrentProjectHolder.GetInstance().Project != null)
{
    AbstractOrchestrationProject project = CurrentProjectHolder.GetInstance().Project;
    if (project.ProjectSetupData.FindProperty("SharepointHost") == null)
    {
        project.ProjectSetupData.AddProperty(new Property("SharepointHost", "http://localhost/"));
    }
}

If you have a password field make sure to set it with the third (3rd) argument

if (project.ProjectSetupData.FindProperty("SharepointPassword") == null)
{
    project.ProjectSetupData.AddProperty(new Property("SharepointPassword", "password", true));
}

You can see this from the following class.

namespace LogicBase.Core
public class Property

public Property(string name, string value, bool isPasswordProperty)

Protirus