You are viewing limited content. For full access, please sign in.

Question

Question

How do I set the OutputEntry token for a Custom Workflow activity?

asked on April 28, 2017

I've got a custom activity that I've developed that creates a new entry in a Laserfiche Repository.  l'd like the workflow to be able to perform other actions on this activity once it is created.  Is there a way to do this so that is works similar to the standard "create entry" activity?  By that I mean that you can specify another activity to perform the action on the newly created entry by selecting the "Other Entry" radio button on the activity instead of the default "Starting Entry".

I know I could work around this by passing the entry id as an output token and then just running a "find entry" activity to retrieve that token value.  From there, I could allow other activities to make changes to the entry returned in the "find entry" activity.  It would work but isn't quite as elegant.

0 0

Answer

SELECTED ANSWER
replied on April 28, 2017

You'd need to add this to the proxy:

        /// <summary>
        /// Gets the output entry.
        /// </summary>
        /// <value>The output entry.</value>
        [System.ComponentModel.ReadOnlyAttribute(true)]
        [SRDisplayName("CreateEntryActivity_OutputEntry_Name")]
        [Browsable(false)]
        [AdvertiseBindingAttribute (true)]
        public EntryInformation82 OutputEntry
        {
            get
            {
                return null;
            }
        } 

and this to the activity code:

       /// <summary>
        /// Gets or sets the output entry.
        /// </summary>
        /// <value>The output entry value.</value>
        public EntryInformation82 OutputEntry
        {
            get { return (EntryInformation82)this.GetValue(OutputEntryProperty); }
            set { this.SetValue(OutputEntryProperty, value); }
        } 


        /// <summary>The output entry property.</summary>
        internal const string OutputEntryPropertyName = "OutputEntry";

        /// <summary>The output entry property.</summary>
        private static DependencyProperty OutputEntryProperty = DependencyProperty.Register(OutputEntryPropertyName, typeof(EntryInformation82), typeof(CreateEntryTaskActivity)); 

Then you need to set all its properties using this constructor:

 public EntryInformation82(string fullpath, int id, string repository, string server, Guid entryGuid) 

(where full path is parent path\entry name)

0 0

Replies

replied on April 28, 2017

Miruna,

This looks great!  Only two minor snags so far:

1) The compiler didn't like "SRDisplayName" in the proxy.  I replaced with "DisplayNameAttribute" but this may be wrong.

2) The compiler doesn't like "typeof(CreateEntryTaskActivity)" on the last line of your second code snippet.  It says the type or namespace can't be found.  Missing reference maybe?  Not sure how to fix this one.

Peter

0 0
replied on May 1, 2017
  1. That's fine, SRDisplayName is a local class we use for localization.
  2. Sorry, I should've been clearer. The type should be your activity type.
0 0
replied on May 2, 2017

Awesome!  Worked great.  Should have recognized "CreateEntryTaskActivity" was the name of your activity.  Seems obvious now.  Thanks for your help on this.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.